From 1d9589db9995032960b9f1e8fbc1451cfffed365 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 20 Aug 2013 23:20:56 +0000 Subject: [PATCH] If et2 object changes, we need the new one, not reject. --- phpgwapi/js/jsapi/app_base.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index 730a43fc8d..793f45807b 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -78,19 +78,17 @@ var AppJS = Class.extend({ /** * This function is called when the etemplate2 object is loaded * and ready. If you must store a reference to the et2 object, - * make sure to clean it up in destroy(). + * make sure to clean it up in destroy(). Note that this can be called + * several times, with different et2 objects, as templates are loaded. * * @param et2 etemplate2 Newly ready object */ et2_ready: function(et2) { - if(this.et2 === null) + if(this.et2 !== null) { - this.et2 = et2.widgetContainer; - } - else - { - egw.debug('warn', "Tried to overwrite et2 object"); + egw.debug('log', "Changed et2 object"); } + this.et2 = et2.widgetContainer; }, /**