Ensure Element.hide and Element.show return an element, even if you pass an element ID.

This commit is contained in:
Tobie Langel 2008-09-06 22:47:26 -07:00
parent ae707f4475
commit 6004aa8289
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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;
},