more tweaks
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 2 Feb 2006 19:57:51 +0000 (19:57 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 2 Feb 2006 19:57:51 +0000 (19:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2944 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/browser.xul

index d748ad1..ac4ece4 100644 (file)
                                g.error.sdump('D_TRACE','my_init() for util_browser.xul');
 
                                g.cgi = new CGI();
-                               var name = g.cgi.param('tab_name') || g.cgi.param('name') || 'Browser';
+                               var name = g.cgi.param('tab_name') || g.cgi.param('name') || null;
+                               if (!name) {
+                                       if (typeof window.xulG == 'object') {
+                                               name = window.xulG.name || window.xulG.tab_name || null;
+                                       }
+                               }
                                var session = g.cgi.param('session');
                                var url; try { url = g.cgi.param('url') || xulG.url } catch(E) { dump(E + '\n'); };
                                if (!url) url = urls.browser;
@@ -55,7 +60,7 @@
                                );
 
                                if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
-                                       try { window.xulG.set_tab_name(name); } catch(E) { alert(E); }
+                                       if (name) try { window.xulG.set_tab_name(name); } catch(E) { alert(E); }
                                }
                                if (typeof window.xulG && window.xulG.show_nav_buttons) {
                                        document.getElementById('back').hidden = false;