Changeset 3116
- Timestamp:
- 11/21/05 01:54:36 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/prototype_helper.rb (modified) (1 diff)
- trunk/actionpack/test/template/prototype_helper_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r3115 r3116 1 1 *SVN* 2 3 * Pass multiple arguments to Element.show and Element.hide in JavaScriptGenerator instead of using iterators. [Sam Stephenson] 2 4 3 5 * Improve expire_fragment documentation. #2966 [court3nay@gmail.com] trunk/actionpack/lib/action_view/helpers/prototype_helper.rb
r3086 r3116 436 436 # Shows hidden DOM elements with the given +ids+. 437 437 def show(*ids) 438 record " #{ids.inspect}.each(Element.show)"438 record "Element.show(#{ids.map {|id| id.inspect} * ', '})" 439 439 end 440 440 441 441 # Hides the visible DOM elements with the given +ids+. 442 442 def hide(*ids) 443 record " #{ids.inspect}.each(Element.hide)"443 record "Element.hide(#{ids.map {|id| id.inspect} * ', '})" 444 444 end 445 445 trunk/actionpack/test/template/prototype_helper_test.rb
r3086 r3116 180 180 181 181 def test_show 182 assert_equal ' ["foo"].each(Element.show);',182 assert_equal 'Element.show("foo");', 183 183 @generator.show('foo') 184 assert_equal ' ["foo", "bar", "baz"].each(Element.show);',184 assert_equal 'Element.show("foo", "bar", "baz");', 185 185 @generator.show('foo', 'bar', 'baz') 186 186 end 187 187 188 188 def test_hide 189 assert_equal ' ["foo"].each(Element.hide);',189 assert_equal 'Element.hide("foo");', 190 190 @generator.hide('foo') 191 assert_equal ' ["foo", "bar", "baz"].each(Element.hide);',191 assert_equal 'Element.hide("foo", "bar", "baz");', 192 192 @generator.hide('foo', 'bar', 'baz') 193 193 end