[Chameleon-dev] [Bug 171] [Chameleon Core] enhancement: popup manager when session expires

bugzilla-daemon at bugzilla.maptools.org bugzilla-daemon at bugzilla.maptools.org
Tue Dec 13 10:49:27 EST 2005


http://bugzilla.maptools.org/show_bug.cgi?id=171





------- Additional Comments From berend.veldkamp at aris.nl  2005-12-13 10:49 -------
Here's some code I wrote to close all popups when the main application window
closes or refreshes. Maybe it can be used here as well.

It works for IE and W3 DOM compliant browsers, but not for Opera, so some work
may be needed.
Also, this closes popups after *any* refresh, for instance when zooming in. This
may or may not be desirable.

Replacement JavaScript code for CWCPopup->DrawPublish():

var wh = window.open('{$url}', '{$name}', '{$options}');
if (!wh)
{
  alert( 'unable to open popup dialog.  Perhaps you have a popup blocker
installed?' );
}
else
{
  if (window.opera) // Opera
    window.opera.addEventListener("BeforeEvent.unload", function(){wh.close()},
false);
  else if (window.addEventListener) // W3 DOM
    window.addEventListener("unload", function(){wh.close()}, false);
  else if (window.attachEvent) // IE
    window.attachEvent("onunload", function(){wh.close()});
  wh.focus();
}



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Please do NOT reply to this email, use the link above instead to 
login to bugzilla and submit your comment. Any email reply to this
address will be lost.


More information about the Chameleon-dev mailing list