forked from extern/egroupware
Make sure widgetContainer is initialized before loading, prevents timing problems
This commit is contained in:
parent
3623ee6e72
commit
bdb148d167
@ -193,8 +193,29 @@ etemplate2.prototype.load = function(_name, _url, _data)
|
|||||||
// Create the document fragment into which the HTML will be injected
|
// Create the document fragment into which the HTML will be injected
|
||||||
var frag = document.createDocumentFragment();
|
var frag = document.createDocumentFragment();
|
||||||
|
|
||||||
// Asynchronously load the XET file (code below is executed ahead of the
|
|
||||||
// code in the loadXMLFromURL function)
|
// Clear any existing instance
|
||||||
|
this.clear();
|
||||||
|
|
||||||
|
// Create the basic widget container and attach it to the DOM
|
||||||
|
this.widgetContainer = new et2_container(null);
|
||||||
|
this.widgetContainer.setApiInstance(egw(appname, egw.elemWindow(this.DOMContainer)));
|
||||||
|
this.widgetContainer.setInstanceManager(this);
|
||||||
|
this.widgetContainer.setParentDOMNode(this.DOMContainer);
|
||||||
|
|
||||||
|
// store the id to submit it back to server
|
||||||
|
if(_data) {
|
||||||
|
this.etemplate_exec_id = _data.etemplate_exec_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set app_header
|
||||||
|
if (window.opener) { // popup
|
||||||
|
document.title = _data.app_header;
|
||||||
|
} else {
|
||||||
|
// todo for idots or jdots framework
|
||||||
|
}
|
||||||
|
|
||||||
|
// Asynchronously load the XET file
|
||||||
et2_loadXMLFromURL(_url, function(_xmldoc) {
|
et2_loadXMLFromURL(_url, function(_xmldoc) {
|
||||||
|
|
||||||
// Scan for templates and store them
|
// Scan for templates and store them
|
||||||
@ -224,27 +245,6 @@ etemplate2.prototype.load = function(_name, _url, _data)
|
|||||||
this.resize();
|
this.resize();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
// Clear any existing instance
|
|
||||||
this.clear();
|
|
||||||
|
|
||||||
// Create the basic widget container and attach it to the DOM
|
|
||||||
this.widgetContainer = new et2_container(null);
|
|
||||||
this.widgetContainer.setApiInstance(egw(appname, egw.elemWindow(this.DOMContainer)));
|
|
||||||
this.widgetContainer.setInstanceManager(this);
|
|
||||||
this.widgetContainer.setParentDOMNode(this.DOMContainer);
|
|
||||||
|
|
||||||
// store the id to submit it back to server
|
|
||||||
if(_data) {
|
|
||||||
this.etemplate_exec_id = _data.etemplate_exec_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
// set app_header
|
|
||||||
if (window.opener) { // popup
|
|
||||||
document.title = _data.app_header;
|
|
||||||
} else {
|
|
||||||
// todo for idots or jdots framework
|
|
||||||
}
|
|
||||||
|
|
||||||
// Split the given data into array manager objects and pass those to the
|
// Split the given data into array manager objects and pass those to the
|
||||||
// widget container
|
// widget container
|
||||||
this.widgetContainer.setArrayMgrs(this._createArrayManagers(_data));
|
this.widgetContainer.setArrayMgrs(this._createArrayManagers(_data));
|
||||||
|
Loading…
Reference in New Issue
Block a user