back to using an array for win_list. registration of app shell's. Only need to...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 11 Jul 2005 08:18:47 +0000 (08:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 11 Jul 2005 08:18:47 +0000 (08:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1119 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/util/win.js

index 1661089..954636f 100644 (file)
@@ -100,21 +100,32 @@ function SafeWindowOpen(url,title,features)
        return w;
 } 
 
+function register_AppShell(w) {
+       sdump('D_WIN',arg_dump(arguments,{0:true}));
+       mw.G.appshell_list.push(w);
+}
+
+function unregister_AppShell(w) {
+       sdump('D_WIN',arg_dump(arguments,{0:true}));
+       mw.G.appshell_list = filter_list( mw.G.appshell_list, function(e){return(e!=w);} );
+}
+
 function register_window(w) {
        sdump('D_WIN',arg_dump(arguments,{0:true}));
-       mw.G.win_list[w.toString()] = w;
+       mw.G.win_list.push(w);
        mw.G.last_win = w;
 }
 
 function unregister_window(w) {
        sdump('D_WIN',arg_dump(arguments,{0:true}));
-       try { delete mw.G.win_list[w.toString()]; } catch(E) { mw.G.win_list[w.toString()] = false; }   
+       mw.G.win_list = filter_list( mw.G.win_list, function(e){return(e!=w);} );
+       mw.G.last_win = mw.G.win_list[ mw.G.win_list.length - 1 ];
 }
 
 function close_all_windows() {
        sdump('D_WIN',arg_dump(arguments));
        var w;
-       for (var i in mw.G.win_list) {
+       for (var i in mw.G.appshell_list) {
                sdump('D_WIN','\tconsidering ' + i + '...');
                if (mw.G.win_list[i] != mw) {
                        sdump('D_WIN','closing');