in partnership with mediatemple

Ticket #652 (closed enhancement: wontfix)

Opened 6 months ago

Last modified 2 days ago

window.addEvent('resize' ... IE bug

Reported by: acerbiter Owned by: digitarald
Type: enhancement Priority: minor
Milestone: Mootools version 1.2 Component: Core
Keywords: custom event window resize Cc:

Description

well, seems that in IE, window.onresize is fired when the html body's size inside a browser's window changes (despite that the actual window size doesn't). This can create issues especially when your function executed upon the 'resize' event changes the body element's size (e.g. infinite loops). A possible fix would be to check the actual window size against stored values e.g.:

var windowSize;

function windowSizeChanged(){
	var tmp = window.getSize();
	return !( (tmp.size.x == windowSize.size.x) && (tmp.size.y == windowSize.size.y) );
}

function onWindowResize(){
	...
	windowSize = window.getSize();
}

window.addEvent('domready', function(){	
	window.addEvent('resize', function(){
		if ( windowSizeChanged() ){
			onWindowResize();
		}
	});
});

but that just shouldn't cut it, especially from OO point of view. It would be much more elegant if the window object only fired the 'resize' event when the actual window size changes ... I assume this would require overriding the window's methods inherited from Element but i believe it's definitely worth having the resize bug fixed forever.

Change History

Changed 4 months ago by digitarald

  • status changed from new to assigned
  • component changed from Core to Plugins
  • owner set to digitarald
  • milestone changed from Mootools version 1.2 to Mootools version 1.3
  • keywords custom event added; ie bug removed
  • type changed from defect to enhancement

Changed 2 days ago by tomocchino

  • status changed from assigned to closed
  • resolution set to wontfix
  • component changed from Plugins to Core
  • milestone set to Mootools version 1.2
Note: See TracTickets for help on using tickets.