Permalink
Browse files

added showOrHide method to HTMLElement

  • Loading branch information...
1 parent b1c7372 commit aaceabacfaf3a2ed6eb13005892339b08766f50a @juzna committed Jan 13, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/prototype/dom/dom.js
View
@@ -412,6 +412,17 @@ Element.Methods = {
return element;
},
+ /**
+ * Element.showOrHide(@element) -> Element
+ *
+ * Shows element if second argument is true; otherwise hides it
+ *
+ * See show or hide methods
+ */
+ showOrHide: function(element, show) {
+ return Element[show ? 'show' : 'hide'](element);
+ },
+
/**
* Element.remove(@element) -> Element
*

0 comments on commit aaceaba

Please sign in to comment.