From daaf795e8fcd14cd28bc76fcefa92979369b3556 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 18 May 2017 11:45:56 -0600 Subject: [PATCH] Fix apps using an iframe for admin could not properly load the sidebox tree --- api/js/etemplate/et2_core_DOMWidget.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_core_DOMWidget.js b/api/js/etemplate/et2_core_DOMWidget.js index 6411b1b405..ff4cb2da6b 100644 --- a/api/js/etemplate/et2_core_DOMWidget.js +++ b/api/js/etemplate/et2_core_DOMWidget.js @@ -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); }