Skip to content

Commit

Permalink
MDL-40142 navigation: fixed chainable issue with navigation JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jun 16, 2013
1 parent d3cf194 commit 5d9349b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Expand Up @@ -391,11 +391,15 @@ BRANCH.prototype = {
}, },
/** /**
* Attaches required events to the branch structure. * Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/ */
wire : function() { wire : function() {
this.node = this.node || Y.one('#'+this.get('id')); this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) { if (!this.node) {
return false; return this;
} }
if (this.get('expandable')) { if (this.get('expandable')) {
this.node.setAttribute('data-expandable', '1'); this.node.setAttribute('data-expandable', '1');
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -391,11 +391,15 @@ BRANCH.prototype = {
}, },
/** /**
* Attaches required events to the branch structure. * Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/ */
wire : function() { wire : function() {
this.node = this.node || Y.one('#'+this.get('id')); this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) { if (!this.node) {
return false; return this;
} }
if (this.get('expandable')) { if (this.get('expandable')) {
this.node.setAttribute('data-expandable', '1'); this.node.setAttribute('data-expandable', '1');
Expand Down
6 changes: 5 additions & 1 deletion blocks/navigation/yui/src/navigation/js/navigation.js
Expand Up @@ -389,11 +389,15 @@ BRANCH.prototype = {
}, },
/** /**
* Attaches required events to the branch structure. * Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/ */
wire : function() { wire : function() {
this.node = this.node || Y.one('#'+this.get('id')); this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) { if (!this.node) {
return false; return this;
} }
if (this.get('expandable')) { if (this.get('expandable')) {
this.node.setAttribute('data-expandable', '1'); this.node.setAttribute('data-expandable', '1');
Expand Down

0 comments on commit 5d9349b

Please sign in to comment.