We have a big enterprise application that use window.showModalDialog to display modal windows. We used them at lots of places to show dialog messages and child forms. Now we want to support all the browsers, because in Chrome window.showModalDialog does not display modal dialog, we are thinking of using overlays div over the content and then display top window with div using higher z-index. It works beautifully, But following is the big problem we are facing - 1. Most of code use the following syntax -
var return = window.showModalDialog();
doSomethingWithReturnValue(return);
method to display modalDialog, now the code will not execute and wait for user to close the window the then the next line of code doSomethingWithReturn() method will execute, This code in used at atleast hundards of places in the code. There there is way in javascript to replace window.showModalDialog() with something like follows -
var return = showDialogWindow() // this will use overlays and div with higher index to // display the content
Our problem is that showDialogWindow() will return immediately and all the code will execute without waiting for user to close the window. Alternative will be to use callback, but then results will be to change the whole code around and more testing and potential for more bugs.
Is there way design showDialogWindow() in such a way that showDialogWidnow will wait as long as user have not close the top div.
Thanks, If you have more questions please let me know.