mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
don't always add core/common and core/main during "sorting"
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
ccf57e0715
commit
37e3115cb4
2 changed files with 12 additions and 1 deletions
|
|
@ -49,6 +49,12 @@ class BeforeTemplateRenderedListener implements IEventListener {
|
|||
|
||||
\OC_Util::addStyle('server', null, true);
|
||||
|
||||
if ($event instanceof BeforeLoginTemplateRenderedEvent) {
|
||||
// todo: make login work without these
|
||||
Util::addScript('core', 'common');
|
||||
Util::addScript('core', 'main');
|
||||
}
|
||||
|
||||
if ($event instanceof BeforeTemplateRenderedEvent) {
|
||||
// include common nextcloud webpack bundle
|
||||
Util::addScript('core', 'common');
|
||||
|
|
|
|||
|
|
@ -212,7 +212,12 @@ class Util {
|
|||
$sortedScripts = $sortedScripts ? array_merge(...array_values(($sortedScripts))) : [];
|
||||
|
||||
// Override core-common and core-main order
|
||||
array_unshift($sortedScripts, 'core/js/common', 'core/js/main');
|
||||
if (in_array('core/js/main', $sortedScripts)) {
|
||||
array_unshift($sortedScripts, 'core/js/main');
|
||||
}
|
||||
if (in_array('core/js/common', $sortedScripts)) {
|
||||
array_unshift($sortedScripts, 'core/js/common');
|
||||
}
|
||||
|
||||
return array_unique($sortedScripts);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue