Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6639 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Element.hide method does not handle multiple elements (as it had before)

Reported by: morris082 Assigned to: David
Priority: normal Milestone: 1.x
Component: ActiveRecord Version:
Severity: minor Keywords:
Cc:

Description

Recently updated to prototype 1.5rc1 for scriptaculous, now getting problems where I had used Element.hide('el1', 'el2', 'el3'), as new method only takes one argument.

Request that relevant Element methods (ie: visible, toggle, show, hide, remove, updated) allow multiple elements to be passed as arguments.

suggested patch from line 1045:

hide: function(element) {
    for (var i = 0; i < arguments.length; i++) {
	var element = $(arguments[i]);
	$(element).style.display = 'none';
	}
  }

Change History

11/19/06 18:21:37 changed by madrobby

  • status changed from new to closed.
  • resolution set to wontfix.

That's a decision that was taken that breaks backwards compatibility for more consistence as these methods now return the element to be chainable. Use:

['you','elements','as','an','array'].each(Element.hide);

instead. See the Prototype CHANGELOG for more on this.