MDL-68833 theme_boost: prevent having to call init on the loader
authorBas Brands <bas@moodle.com>
Thu, 28 May 2020 16:17:10 +0000 (18:17 +0200)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 3 Jun 2020 01:21:48 +0000 (09:21 +0800)
This was added in a previous master-only issue and breaks backwards compatability with child themes.

There is no need to have the init function here.

theme/boost/amd/build/loader.min.js
theme/boost/amd/build/loader.min.js.map
theme/boost/amd/src/loader.js
theme/boost/templates/columns1.mustache
theme/boost/templates/columns2.mustache
theme/boost/templates/secure.mustache
theme/classic/templates/columns.mustache
theme/classic/templates/contentonly.mustache
theme/classic/templates/secure.mustache

index 8d040cd..baacba5 100644 (file)
Binary files a/theme/boost/amd/build/loader.min.js and b/theme/boost/amd/build/loader.min.js differ
index 9549e86..bcde39c 100644 (file)
Binary files a/theme/boost/amd/build/loader.min.js.map and b/theme/boost/amd/build/loader.min.js.map differ
index 5d1d08d..a050c6f 100644 (file)
@@ -78,41 +78,31 @@ const enableTooltips = () => {
     });
 };
 
-/**
- * Bootstrap init function
- */
-const init = () => {
-    const pendingPromise = new Pending('theme_boost/loader:init');
+const pendingPromise = new Pending('theme_boost/loader:init');
 
-    setupBootstrapPendingChecks();
+// Add pending promise event listeners to relevant Bootstrap custom events.
+setupBootstrapPendingChecks();
 
-    // Remember the last visited tabs.
-    rememberTabs();
+// Remember the last visited tabs.
+rememberTabs();
 
-    // Enable all popovers.
-    enablePopovers();
+// Enable all popovers.
+enablePopovers();
 
-    // Enable all tooltips.
-    enableTooltips();
+// Enable all tooltips.
+enableTooltips();
 
-    // Add scroll handling.
-    (new Scroll()).init();
+// Add scroll handling.
+(new Scroll()).init();
 
-    // Disables flipping the dropdowns up and getting hidden behind the navbar.
-    $.fn.dropdown.Constructor.Default.flip = false;
+// Disables flipping the dropdowns up and getting hidden behind the navbar.
+$.fn.dropdown.Constructor.Default.flip = false;
 
-    // Setup Aria helpers for Bootstrap features.
-    Aria.init();
+// Setup Aria helpers for Bootstrap features.
+Aria.init();
 
-    pendingPromise.resolve();
-};
+pendingPromise.resolve();
 
-/**
- * Set up the search.
- *
- * @method init
- */
 export {
-    init,
-    Bootstrap
+    Bootstrap,
 };
index 08a0a12..c5810dc 100644 (file)
@@ -65,7 +65,6 @@
 </body>
 </html>
 M.util.js_pending('theme_boost/loader');
-require(['theme_boost/loader'], function(loader) {
-    loader.init();
+require(['theme_boost/loader'], function() {
     M.util.js_complete('theme_boost/loader');
 });
index fcb9b2c..5feab1c 100644 (file)
@@ -97,8 +97,7 @@
 </html>
 {{#js}}
 M.util.js_pending('theme_boost/loader');
-require(['theme_boost/loader'], function(loader) {
-    loader.init();
+require(['theme_boost/loader'], function() {
     M.util.js_complete('theme_boost/loader');
 });
 
index 9d8b289..21f48b6 100644 (file)
@@ -88,7 +88,6 @@
 </body>
 </html>
 M.util.js_pending('theme_boost/loader');
-require(['theme_boost/loader'], function(loader) {
-    loader.init();
+require(['theme_boost/loader'], function() {
     M.util.js_complete('theme_boost/loader');
 });
index 1ae3fc6..787b41f 100644 (file)
@@ -97,8 +97,7 @@
 </html>
 {{#js}}
 M.util.js_pending('theme_boost/loader');
-require(['theme_boost/loader'], function(loader) {
-    loader.init();
+require(['theme_boost/loader'], function() {
     M.util.js_complete('theme_boost/loader');
 });
 {{/js}}
index 4d8ca86..cb5d9c2 100644 (file)
@@ -69,8 +69,7 @@
 </html>
 {{#js}}
 M.util.js_pending('theme_boost/loader');
-require(['theme_boost/loader'], function(loader) {
-    loader.init();
+require(['theme_boost/loader'], function() {
     M.util.js_complete('theme_boost/loader');
 });
 {{/js}}
index 1d06183..b237592 100644 (file)
 </html>
 {{#js}}
 M.util.js_pending('theme_boost/loader');
-require(['theme_boost/loader'], function(loader) {
-    loader.init();
+require(['theme_boost/loader'], function() {
     M.util.js_complete('theme_boost/loader');
 });
 {{/js}}