MDL-40142 navigation: fixed chainable issue with navigation JS
authorSam Hemelryk <sam@moodle.com>
Wed, 12 Jun 2013 04:23:13 +0000 (16:23 +1200)
committerSam Hemelryk <sam@moodle.com>
Sun, 16 Jun 2013 21:15:51 +0000 (09:15 +1200)
blocks/navigation/yui/navigation/navigation.js

index 2189d51..a987317 100644 (file)
@@ -340,11 +340,15 @@ BRANCH.prototype = {
     },
     /**
      * Attaches required events to the branch structure.
+     *
+     * @chainable
+     * @method wire
+     * @return {BRANCH} This function is chainable, it always returns itself.
      */
     wire : function() {
         this.node = this.node || Y.one('#'+this.get('id'));
         if (!this.node) {
-            return false;
+            return this;
         }
         if (this.get('expandable')) {
             this.event_ajaxload = this.node.on('ajaxload|click', this.ajaxLoad, this);