From: Jason Etheridge Date: Wed, 20 Jun 2012 19:40:27 +0000 (-0400) Subject: tweaks to window titlebars X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fphasefx%2Ftab_name_in_title_bar;p=working%2FEvergreen.git 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 --- 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); }