Fix +10613 don't crash when there is not a next panel

pull/227/head
Ruben Daniels 2015-12-03 10:54:53 +00:00 zatwierdzone przez nightwing
rodzic 235e674419
commit 33e8b0ca57
1 zmienionych plików z 27 dodań i 25 usunięć

Wyświetl plik

@ -585,32 +585,34 @@ define(function(require, module, exports) {
next = next.selectNodes("tab|hsplitbox|vsplitbox")[op](); next = next.selectNodes("tab|hsplitbox|vsplitbox")[op]();
} }
// move all pages to another pane if (next) {
getTabs().forEach(function(tab) { // move all pages to another pane
tab.attachTo(next.cloud9pane, null, true); getTabs().forEach(function(tab) {
}); tab.attachTo(next.cloud9pane, null, true);
});
// destroy aml element
amlPane.destroy(true, true); // destroy aml element
amlPane.destroy(true, true);
// Clean up tree
if (last) {
var place = parent.nextSibling;
var grandpa = parent.parentNode;
parent.removeChild(last);
if (parent != options.container)
parent.destroy(true, true);
grandpa.insertBefore(last, place);
queue = [grandpa] // Clean up tree
if (last) {
var size = grandpa.$vbox ? "height" : "width"; var place = parent.nextSibling;
last.setAttribute(size, parent[size]); var grandpa = parent.parentNode;
size = grandpa.$vbox ? "width" : "height"; parent.removeChild(last);
last.setAttribute(size, ""); if (parent != options.container)
} parent.destroy(true, true);
else { grandpa.insertBefore(last, place);
queue = [parent];
queue = [grandpa]
var size = grandpa.$vbox ? "height" : "width";
last.setAttribute(size, parent[size]);
size = grandpa.$vbox ? "width" : "height";
last.setAttribute(size, "");
}
else {
queue = [parent];
}
} }
if (last && last.parentNode.localName == "bar") { if (last && last.parentNode.localName == "bar") {