From 50550acb3bb208281b7a2daa43bed9289dceecbe Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 7 Sep 2015 03:51:29 +0400 Subject: [PATCH] fix form.attachTo breaking apf parentNode --- plugins/c9.ide.ui/forms.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/c9.ide.ui/forms.js b/plugins/c9.ide.ui/forms.js index 5b57dde9..ba36edb7 100644 --- a/plugins/c9.ide.ui/forms.js +++ b/plugins/c9.ide.ui/forms.js @@ -477,8 +477,12 @@ define(function(require, exports, module) { container.parentNode = htmlNode; htmlNode = htmlNode.$int; } - - htmlNode.insertBefore(container.$ext, beforeNode || null); + // if we have apf node, make sure apf child-parent links do not get broken + if (htmlNode.host && container.host) { + htmlNode.host.insertBefore(container.host, beforeNode && beforeNode.host); + } else { + htmlNode.insertBefore(container.$ext, beforeNode || null); + } show(); }