Skip to content

Commit

Permalink
- adding missing check for the existence of the match argument in wa…
Browse files Browse the repository at this point in the history
…lker methods.
  • Loading branch information
kamicane committed Feb 11, 2010
1 parent ade6a7d commit 522de15
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Source/Element/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,43 +435,43 @@ Element.implement({
},

getPrevious: function(match, nocash){
return document.id(Slick.find(this, '!+ ' + match));
return document.id(Slick.find(this, '!+ ' + (match || '')));
},

getAllPrevious: function(match, nocash){
return Slick.search(this, '!~ ' + match, new Elements);
return Slick.search(this, '!~ ' + (match || ''), new Elements);
},

getNext: function(match, nocash){
return document.id(Slick.find(this, '+ ' + match));
return document.id(Slick.find(this, '+ ' + (match || '')));
},

getAllNext: function(match, nocash){
return Slick.search(this, '~ ' + match, new Elements);
return Slick.search(this, '~ ' + (match || ''), new Elements);
},

getFirst: function(match, nocash){
return document.id(Slick.find(this, '^ ' + match));
return document.id(Slick.find(this, '^ ' + (match || '')));
},

getLast: function(match, nocash){
return document.id(Slick.find(this, '!^ ' + match));
return document.id(Slick.find(this, '!^ ' + (match || '')));
},

getParent: function(match, nocash){
return document.id(Slick.find(this, '! ' + match));
return document.id(Slick.find(this, '! ' + (match || '')));
},

getParents: function(match, nocash){
return Slick.search(this, '! ' + match, new Elements);
return Slick.search(this, '! ' + (match || ''), new Elements);
},

getSiblings: function(match, nocash){
return Slick.search(this, '~~ ' + match, new Elements);
return Slick.search(this, '~~ ' + (match || ''), new Elements);
},

getChildren: function(match, nocash){
return Slick.search(this, '> ' + match, new Elements);
return Slick.search(this, '> ' + (match || ''), new Elements);
},

getWindow: function(){
Expand Down

0 comments on commit 522de15

Please sign in to comment.