Pass current app to egw_app_header() so it can set header for correct app. Fixes sometimes wrong app header shown.

This commit is contained in:
Nathan Gray 2013-12-23 16:13:40 +00:00
parent a40fdbae0c
commit 9009ef44bb
2 changed files with 4 additions and 3 deletions

View File

@ -692,7 +692,7 @@ function etemplate2_handle_load(_type, _response)
// need to set app_header before message, as message temp. replaces app_header
if (typeof data.data == 'object' && typeof data.data.app_header == 'string')
{
window.egw_app_header(data.data.app_header);
window.egw_app_header(data.data.app_header, data.data.currentapp||null);
delete data.data.app_header;
}

View File

@ -313,13 +313,14 @@ function egw_message(_msg, _type)
* Update app-header and website-title
*
* @param _header
* @param {_app=null} Application name, if not for the current app
*/
function egw_app_header(_header)
function egw_app_header(_header,_app)
{
var framework = egw_getFramework();
if (framework && !window.opener) // not for popups
{
var app = egw_getAppName();
var app = _app || egw_getAppName();
var title = document.title.replace(/[.*]$/, '['+_header+']');
framework.setWebsiteTitle.call(window.framework, app, title, _header);