mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 03:13:40 +01:00
do NOT call et2_ready for dialogs with a template, as it would overwrite this.et2 in app.js
This commit is contained in:
parent
374cfffb89
commit
77624244e6
@ -428,7 +428,9 @@ var et2_dialog = (function(){ "use strict"; return et2_widget.extend(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Just template name, it better be loaded already
|
// Just template name, it better be loaded already
|
||||||
this.template.load(template,'',this.options.value||{});
|
this.template.load(template, '', this.options.value || {},
|
||||||
|
// true: do NOT call et2_ready, as it would overwrite this.et2 in app.js
|
||||||
|
undefined, undefined, true);
|
||||||
}
|
}
|
||||||
// set template-name as id, to allow to style dialogs
|
// set template-name as id, to allow to style dialogs
|
||||||
this.div.children().attr('id', template.replace(/^(.*\/)?([^/]+)(\.xet)?$/, '$2').replace(/\./g, '-'));
|
this.div.children().attr('id', template.replace(/^(.*\/)?([^/]+)(\.xet)?$/, '$2').replace(/\./g, '-'));
|
||||||
|
@ -333,8 +333,9 @@ etemplate2.prototype.download = function(_url)
|
|||||||
* @param {object} _data object with attributes content, langRequire, etemplate_exec_id, ...
|
* @param {object} _data object with attributes content, langRequire, etemplate_exec_id, ...
|
||||||
* @param {function} _callback called after tempalte is loaded
|
* @param {function} _callback called after tempalte is loaded
|
||||||
* @param {object} _app local app object
|
* @param {object} _app local app object
|
||||||
|
* @param {boolean} _no_et2_ready true: do not send et2_ready, used by et2_dialog to not overwrite app.js et2 object
|
||||||
*/
|
*/
|
||||||
etemplate2.prototype.load = function(_name, _url, _data, _callback, _app)
|
etemplate2.prototype.load = function(_name, _url, _data, _callback, _app, _no_et2_ready)
|
||||||
{
|
{
|
||||||
var app = _app || window.app;
|
var app = _app || window.app;
|
||||||
this.name = _name; // store top-level template name to have it available in widgets
|
this.name = _name; // store top-level template name to have it available in widgets
|
||||||
@ -529,11 +530,11 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback, _app)
|
|||||||
{
|
{
|
||||||
_callback.call(window,this,_name);
|
_callback.call(window,this,_name);
|
||||||
}
|
}
|
||||||
if(app_callback && _callback != app_callback)
|
if(app_callback && _callback != app_callback && !_no_et2_ready)
|
||||||
{
|
{
|
||||||
app_callback.call(window,this,_name);
|
app_callback.call(window,this,_name);
|
||||||
}
|
}
|
||||||
if(appname && appname != this.app && typeof app[this.app] == "object")
|
if(appname && appname != this.app && typeof app[this.app] == "object" && !_no_et2_ready)
|
||||||
{
|
{
|
||||||
// Loaded a template from a different application?
|
// Loaded a template from a different application?
|
||||||
// Let the application that loaded it know too
|
// Let the application that loaded it know too
|
||||||
|
Loading…
Reference in New Issue
Block a user