MDL-38661 JavaScript: Add missing lazy loading on collapseall
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 18 Sep 2013 10:04:25 +0000 (11:04 +0100)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 18 Sep 2013 10:04:31 +0000 (11:04 +0100)
course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-debug.js
course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-min.js
course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander.js
course/yui/src/categoryexpander/js/categoryexpander.js

index 6313e5c..e8425e0 100644 (file)
Binary files a/course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-debug.js and b/course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-debug.js differ
index fcf1759..98eb15b 100644 (file)
Binary files a/course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-min.js and b/course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander-min.js differ
index 42aae83..dd1d5b4 100644 (file)
Binary files a/course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander.js and b/course/yui/build/moodle-course-categoryexpander/moodle-course-categoryexpander.js differ
index ec6f9c1..92833ac 100644 (file)
@@ -89,7 +89,7 @@ NS.setup_keyboard_listeners = function() {
  */
 NS.toggle_category_expansion = function(e) {
     // Load the actual dependencies now that we've been called.
-    Y.use('io-base', 'json-parse', 'moodle-core-notification', 'anim', function() {
+    Y.use('io-base', 'json-parse', 'moodle-core-notification', 'anim-node-plugin', function() {
         // Overload the toggle_category_expansion with the _toggle_category_expansion function to ensure that
         // this function isn't called in the future, and call it for the first time.
         NS.toggle_category_expansion = NS._toggle_category_expansion;
@@ -106,7 +106,7 @@ NS.toggle_category_expansion = function(e) {
  */
 NS.toggle_coursebox_expansion = function(e) {
     // Load the actual dependencies now that we've been called.
-    Y.use('io-base', 'json-parse', 'moodle-core-notification', 'anim', function() {
+    Y.use('io-base', 'json-parse', 'moodle-core-notification', 'anim-node-plugin', function() {
         // Overload the toggle_coursebox_expansion with the _toggle_coursebox_expansion function to ensure that
         // this function isn't called in the future, and call it for the first time.
         NS.toggle_coursebox_expansion = NS._toggle_coursebox_expansion;
@@ -261,7 +261,26 @@ NS.run_expansion = function(categorynode) {
     categorychildren.fx.run();
 };
 
+/**
+ * Toggle collapsing of all nodes.
+ *
+ * @method collapse_expand_all
+ * @private
+ * @param {EventFacade} e
+ */
 NS.collapse_expand_all = function(e) {
+    // Load the actual dependencies now that we've been called.
+    Y.use('io-base', 'json-parse', 'moodle-core-notification', 'anim-node-plugin', function() {
+        // Overload the collapse_expand_all with the _collapse_expand_all function to ensure that
+        // this function isn't called in the future, and call it for the first time.
+        NS.collapse_expand_all = NS._collapse_expand_all;
+        NS.collapse_expand_all(e);
+    });
+
+    e.preventDefault();
+};
+
+NS._collapse_expand_all = function(e) {
     // The collapse/expand button has no actual target but we need to prevent it's default
     // action to ensure we don't make the page reload/jump.
     e.preventDefault();