diff --git a/package.json b/package.json index 1623430a..bce285e1 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "c9.ide.ace.split": "#0ae0151c78", "c9.ide.ace.statusbar": "#d95be89d53", "c9.ide.ace.stripws": "#cf0f42ac59", - "c9.ide.behaviors": "#6aad7006a0", + "c9.ide.behaviors": "#c3a9402cde", "c9.ide.closeconfirmation": "#a28bfd8272", "c9.ide.configuration": "#adf50fdaa2", "c9.ide.dialog.wizard": "#7667ec79a8", diff --git a/plugins/c9.ide.editors/pane.js b/plugins/c9.ide.editors/pane.js index 851de469..aeb17e1a 100644 --- a/plugins/c9.ide.editors/pane.js +++ b/plugins/c9.ide.editors/pane.js @@ -230,7 +230,7 @@ define(function(require, module, exports) { } function hsplit(far, vertically, split, ignore) { - if (!split || !split.parentNode) split = amlPane; + if (!$isValidSplit(split) || !split.parentNode) split = amlPane; queue = []; // Used for resizing later @@ -270,6 +270,16 @@ define(function(require, module, exports) { return newtab.cloud9pane; } + function $isValidSplit(container) { + // would be better to use tabmanager.containers instead + while (container) { + if (container.localName == "bar") + break; + container = container.parentNode; + } + return !!container; + } + // Resize all editors in the queue function resizeAll(){ queue.forEach(function(node) { @@ -399,6 +409,8 @@ define(function(require, module, exports) { } if (next) { + if (!$isValidSplit(next)) + return; // Moving from horizontal to vertical or vice verse if (force || next.parentNode.localName != amlPane.parentNode.localName) { var tosplit = force || next.parentNode.localName == "bar"