mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
Fix some legacy parent issues where parent DOM node was not found when needed
- Checking & waiting for promises - Could not get DOM nodes from nm header sub-templates
This commit is contained in:
parent
ed66beaf8f
commit
7b11a25b8d
@ -603,7 +603,11 @@ const Et2WidgetMixin = (superClass) =>
|
|||||||
*
|
*
|
||||||
* @param {Promise[]} promises List of promises from widgets that are not done. Pass an empty array, it will be filled if needed.
|
* @param {Promise[]} promises List of promises from widgets that are not done. Pass an empty array, it will be filled if needed.
|
||||||
*/
|
*/
|
||||||
loadingFinished(promises)
|
loadingFinished(promises : Promise<any>[])
|
||||||
|
{
|
||||||
|
// Note that WebComponents don't do anything here, their lifecycle is different
|
||||||
|
// This is just to support legacy widgets
|
||||||
|
let doLoadingFinished = () =>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* This is needed mostly as a bridge between non-WebComponent widgets and
|
* This is needed mostly as a bridge between non-WebComponent widgets and
|
||||||
@ -629,6 +633,12 @@ const Et2WidgetMixin = (superClass) =>
|
|||||||
|
|
||||||
child.loadingFinished(promises);
|
child.loadingFinished(promises);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
if(typeof promises === "undefined")
|
||||||
|
{
|
||||||
|
return doLoadingFinished();
|
||||||
|
}
|
||||||
|
Promise.all(promises).then(doLoadingFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
getWidgetById(_id)
|
getWidgetById(_id)
|
||||||
|
@ -3848,14 +3848,31 @@ export class et2_nextmatch_header_bar extends et2_DOMWidget implements et2_INext
|
|||||||
return this.filter_div[0];
|
return this.filter_div[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(_sender == this.et2_searchbox) return this.search_box[0];
|
if(_sender == this.et2_searchbox)
|
||||||
if(_sender.id == 'export') return this.right_div[0];
|
{
|
||||||
|
return this.search_box[0];
|
||||||
|
}
|
||||||
|
if(_sender.id == 'export')
|
||||||
|
{
|
||||||
|
return this.right_div[0];
|
||||||
|
}
|
||||||
|
|
||||||
if(_sender && _sender._type == "template")
|
if(_sender && _sender._type == "template")
|
||||||
{
|
{
|
||||||
for(let i = 0; i < this.headers.length; i++)
|
for(let i = 0; i < this.headers.length; i++)
|
||||||
{
|
{
|
||||||
if(_sender.id == this.headers[i].id && _sender._parent == this) return i == 2 ? this.header_row[0] : this.header_div[0];
|
if(_sender.id == this.headers[i].id && _sender._parent == this)
|
||||||
|
{
|
||||||
|
return i == 2 ? this.header_row[0] : this.header_div[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let header of this.headers)
|
||||||
|
{
|
||||||
|
if(header && header.getDOMNode && header.getDOMNode(this))
|
||||||
|
{
|
||||||
|
return header.getDOMNode(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -945,6 +945,7 @@ export class et2_grid extends et2_DOMWidget implements et2_IDetachedDOM, et2_IAl
|
|||||||
const cell = this.managementArray[i];
|
const cell = this.managementArray[i];
|
||||||
if(cell.widget)
|
if(cell.widget)
|
||||||
{
|
{
|
||||||
|
this.removeChild(cell.widget);
|
||||||
cell.widget.destroy();
|
cell.widget.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user