Changeset 4881
- Timestamp:
- 08/30/06 17:54:41 (2 years ago)
- Files:
-
- spinoffs/prototype/CHANGELOG (modified) (1 diff)
- spinoffs/prototype/src/dom.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinoffs/prototype/CHANGELOG
r4880 r4881 1 1 *SVN* 2 3 * For consistency, Element.toggle, Element.show, and Element.hide no longer take an arbitrary number of arguments. [sam] 4 5 !! BACKWARDS COMPATIBILITY CHANGE !! 6 7 If you have code that looks like this: 8 Element.show('page', 'sidebar', 'content'); 9 You need to replace it with code like this: 10 ['page', 'sidebar', 'content'].each(Element.show); 2 11 3 12 * Mix in Form and Form.Element methods to forms and form field elements with $() and $$(). Closes #4448. [Dan Webb, sam] spinoffs/prototype/src/dom.js
r4880 r4881 60 60 }, 61 61 62 toggle: function() { 63 for (var i = 0; i < arguments.length; i++) { 64 var element = $(arguments[i]); 65 Element[Element.visible(element) ? 'hide' : 'show'](element); 66 } 62 toggle: function(element) { 63 element = $(element); 64 Element[Element.visible(element) ? 'hide' : 'show'](element); 67 65 }, 68 66 69 67 hide: function() { 70 for (var i = 0; i < arguments.length; i++) { 71 var element = $(arguments[i]); 72 element.style.display = 'none'; 73 } 68 $(element).style.display = 'none'; 74 69 }, 75 70 76 71 show: function() { 77 for (var i = 0; i < arguments.length; i++) { 78 var element = $(arguments[i]); 79 element.style.display = ''; 80 } 72 $(element).style.display = ''; 81 73 }, 82 74