[whatwg] modal and modeless windows

Thomas Broyer t.broyer at gmail.com
Fri Apr 27 05:48:44 PDT 2007


2007/4/27, Jon Barnett:
>
> Can I ask how that would work with a dialog?  Would it be like this?
>
> myframeddocument.designMode = "on";
> mytoolbar.hyperlinkButton.onclick =  function() {
>  myframeddocument.body.irrelevant = true;
>  var dialog = window.open("hyperlinkDialog.html");
>  // a dialog where the user may either enter a URL or choose from a preset
> list of pages on his site
>
>  dialog.onunload = function() {
>   processHyperlinkSelections();
>   myframeddocument.body.irrelevant = false;
>  }
> }
>
> Is that really the best way?

If I correctly understood Ian's proposal, the "best way" would be to
not use another window.

1. put the content of hyperlinkDialog.html within the "current" page
(or eventually load it within an iframe) and make it irrelevant=true
(let's call this the "hyperlink editing section")
2. when you click the "hyperlink" toolbar button, make the "hyperlink
editing section" irrelevant=false
3. when the OK or Cancel button inside the "hyperlink editing section"
is clicked, do what's needed and switch the section back to
irrelevant=true

-- 
Thomas Broyer



More information about the whatwg mailing list