Skip to content

Commit

Permalink
Ensure Element.hide and Element.show return an element, even if you p…
Browse files Browse the repository at this point in the history
…ass an element ID.
  • Loading branch information
tobie committed Sep 7, 2008
1 parent ae707f4 commit 6004aa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
* Ensure Element.hide and Element.show return an element, even if you pass an element ID. (Andrew Dupont)

* Fix an issue where Element#getStyle('height') returns null if the height is set to "auto." (kangax, jddalton)

* Add unit tests for Element#descendantOf. (jddalton)
Expand Down
6 changes: 4 additions & 2 deletions src/dom.js
Expand Up @@ -74,12 +74,14 @@ Element.Methods = {
},

hide: function(element) {
$(element).style.display = 'none';
element = $(element);
element.style.display = 'none';
return element;
},

show: function(element) {
$(element).style.display = '';
element = $(element);
element.style.display = '';
return element;
},

Expand Down

0 comments on commit 6004aa8

Please sign in to comment.