in partnership with mediatemple

Ticket #801 (closed defect: invalid)

Opened 3 months ago

Last modified 3 months ago

Hash should be cleaned when passed to Element.setStyles

Reported by: mattcoz Owned by:
Type: defect Priority: major
Milestone: Mootools version 1.2 Component: Core
Keywords: Hash Element Style Cc:

Description

The filter function in the Hash object causes problems in IE when a Hash is passed to the Element.setStyles function. This can be avoided by cleaning the Hash object.

setStyles: function(styles){
	if (Hash.type(styles)) styles = styles.getClean();
	for (var style in styles) this.setStyle(style, styles[style]);
	return this;
}

This also has the nice side effect of increasing performance.

Change History

Changed 3 months ago by kamicane

  • status changed from new to closed
  • resolution set to invalid

Passing an Hash to methods when you see object as type in the documentation is not supported.

If you need to pass hashes to methods that accept object as type, always clean it.

Note: See TracTickets for help on using tickets.