Opened 10 years ago

Closed 10 years ago

#8847 closed task (wontfix)

publish viewport-resize topic

Reported by: bill Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0b2
Keywords: Cc:
Blocked By: Blocking:

Description

As per [16917] and [16979] there's some duplicate code showing up in dijit for detecting whether window resize events are spurious, or actual changes it size.

This can solved by creating a viewport-resize topic that only fires when there's an actual change in size of the viewport.

That will also prevent every single widget from calling getViewport(). (We can even pass the viewport size as a parameter of the topic, and dialog can take advantage of it.)

Change History (1)

comment:1 Changed 10 years ago by bill

Resolution: wontfix
Status: newclosed

Oh, I forgot I had filed a separate ticket for this.

As I wrote in #8313, I was going to add the code below into dijit, but since I found a better solution for IE it no longer seems useful.

// Global notification whenever the viewport changes size.
// IE has spurious 'onresize' events so we filter them out at a global level.
dojo.connect(dojo.global, 'onresize', function(){
	var o = dijit._viewport,
		n = dijit.getViewport();
	if(!o || n.w != o.w || n.h != o.h){
		dijit._viewport = n;
		dojo.publish("/dijit/viewportResize", [n]);
	}
});
Note: See TracTickets for help on using tickets.