From 33e94d355c7e44687b792352326fbd99a556dd8c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 13 Feb 2013 12:47:17 +0000 Subject: [PATCH] Fix app_refresh to support applications that set window.app_refresh instead of calling register_app_refresh() --- phpgwapi/js/jsapi/jsapi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/jsapi/jsapi.js b/phpgwapi/js/jsapi/jsapi.js index 15df86cae2..8d7854ce41 100644 --- a/phpgwapi/js/jsapi/jsapi.js +++ b/phpgwapi/js/jsapi/jsapi.js @@ -235,14 +235,14 @@ function egw_refresh(_msg, _app, _id, _type, _targetapp, _replace, _with) var win = typeof _targetapp != 'undefined' ? egw_appWindow(_targetapp) : window; // if window defines an app_refresh method, just call it - if (typeof win.app_refresh != 'undefined' && win.app_refresh.registered(_app)) + if (typeof win.app_refresh == "function" || typeof win.app_refresh.registered == "function" && win.app_refresh.registered(_app)) { win.app_refresh(_msg, _app, _id, _type); return; } // etemplate2 specific to avoid reloading whole page - if(etemplate2 && etemplate2.getByApplication) + if(typeof etemplate2 != "undefined" && etemplate2.getByApplication) { var et2 = etemplate2.getByApplication(_app); for(var i = 0; i < et2.length; i++)