[Project_owners] Stopping a dialog closing

Alex Vincent ajvincent at gmail.com
Thu Jun 9 02:44:53 EDT 2005


If you're within the event handler, you have a variable called "event"
available to you.  Try it:

<dialog ondialogaccept="dump(event.eventPhase)"/>

Another possibility, if that doesn't work, is:

window.addEventListener("DOMWindowClose", function preventClose(evt) {
  evt.preventDefault();
}, true);

This is a special event dispatched to give chrome windows a chance to
veto the window closing.

On 6/9/05, Brian King <brian at mozdev.org> wrote:
> Alex Vincent wrote:
> > Brian, try:
> >
> > event.preventDefault();
> > event.stopPropagation();
> >
> 
> How do I get the event?
> 
> --
> Brian King
> www.mozdev.org - free project hosting for the Mozilla community
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 


-- 
"The first step in confirming there is a bug in someone else's work is
confirming there are no bugs in your own."
-- Alexander J. Vincent, June 30, 2001


More information about the Project_owners mailing list