From d01d5119ca7a48e37b9fc077047a5a7ce4c3ff8d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 17 Feb 2014 14:58:20 +0000 Subject: [PATCH] calling app[appname].et2_ready(et2,name) with template name as second parameter --- etemplate/js/etemplate2.js | 8 +++++--- phpgwapi/js/jsapi/app_base.js | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 238aabd05b..e4066eed19 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -299,7 +299,9 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) } if(typeof app[appname] == "object") { - app_callback = function(et2) {app[appname].et2_ready(et2);}; + app_callback = function(_et2, _name) { + app[appname].et2_ready(_et2, _name); + }; } // Create the document fragment into which the HTML will be injected @@ -381,11 +383,11 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) // Tell others about it if(typeof _callback == "function") { - _callback.call(window,this); + _callback.call(window,this,_name); } if(app_callback && _callback != app_callback) { - app_callback.call(window,this); + app_callback.call(window,this,_name); } $j(this.DOMContainer).trigger('load', this); diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index 4997bc5b69..30268ef1b2 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -110,9 +110,10 @@ var AppJS = Class.extend( * 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 + * @param {etemplate2} et2 + * @param {string} name template name */ - et2_ready: function(et2) { + et2_ready: function(et2,name) { if(this.et2 !== null) { egw.debug('log', "Changed et2 object");