From c5932601c23452c5666465850742fc997a8a7a66 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 20 Jun 2012 15:40:27 -0400 Subject: [PATCH] tweaks to window titlebars In the login window, fixes the bug preventing the client version from displaying in the titlebar. On main menu windows, append the active tab name to the window titlebar. Minor bug: Admin->Operator Change will wipe out the tab name in the titlebar But I can live with that :) Also, we may want to move util.network.reset_titlebars and util.network.set_user_status from network.js to menu.js Signed-off-by: Jason Etheridge --- .../xul/staff_client/chrome/content/main/menu.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 55a36826ce..37b7f1595a 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1951,6 +1951,7 @@ main.menu.prototype = { if (typeof cw.default_focus == 'function') { cw.default_focus(); } + obj.set_titlebar( tab.label ); } } catch(E) { obj.error.sdump('D_ERROR','init_tab_focus_handler: ' + js2JSON(E)); @@ -2253,6 +2254,19 @@ commands: if (params.src) { help_btn.setAttribute('src', params.src); } } }, + 'set_titlebar' : function(name) { + try { + var obj = this; + JSAN.use('util.network'); + var net = new util.network(); + net.reset_titlebars( obj.data ); + if (name) { + window.document.title = window.document.title + ' : ' + name; + } + } catch(E) { + alert(E+'\n'); + } + }, 'tab_semaphores' : {}, @@ -2325,7 +2339,11 @@ commands: content_params.volume_item_creator = function(a) { return obj.volume_item_creator(a); }; content_params.get_new_session = function(a) { return obj.get_new_session(a); }; content_params.holdings_maintenance_tab = function(a,b,c) { return obj.holdings_maintenance_tab(a,b,c); }; - content_params.set_tab_name = function(name) { tab.label = tab.curindex + ' ' + name; tab.origlabel = name; }; + content_params.set_tab_name = function(name) { + tab.label = tab.curindex + ' ' + name; + tab.origlabel = name; + obj.set_titlebar(tab.label); + }; content_params.set_help_context = function(params) { return obj.set_help_context(params); }; content_params.open_chrome_window = function(a,b,c) { return xulG.window.open(a,b,c); }; content_params.url_prefix = function(url,secure) { return obj.url_prefix(url,secure); }; @@ -2413,6 +2431,7 @@ commands: } else if (typeof cw.default_focus == 'function') { cw.default_focus(); } + obj.set_titlebar( tab.label ); } catch(E) { obj.error.sdump('D_ERROR', 'main.menu, set_tab, onload: ' + E); } -- 2.11.0