Fix apps using an iframe for admin could not properly load the sidebox tree

This commit is contained in:
nathangray 2017-05-18 11:45:56 -06:00
parent b5dc938ae9
commit daaf795e8f

View File

@ -258,7 +258,13 @@ var et2_DOMWidget = (function(){ "use strict"; return et2_widget.extend(et2_IDOM
if(typeof _node == "string")
{
var parent = jQuery('#'+_node);
if(parent.length == 0 )
if(parent.length === 0 && window.parent)
{
// Could not find it, try again with wider context
// (in case there's an iframe in admin, for example)
parent = jQuery('#'+_node, window.parent.document);
}
if(parent.length === 0)
{
this.egw().debug('warn','Unable to find DOM parent node with ID "%s" for widget %o.',_node,this);
}