Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// then the user may remove the last or first tab from it.
idx = pages.indexOf(split.pairs[bRight ? splitLen - 1 : 0].page);
}
else {
var currIdx = pages.indexOf(curr);
idx = currIdx + (bRight ? 1 : -1);
}
if (idx < 0 || idx > pages.length - 1)
return;
// enable split view ONLY for code editors for now...
if (!this.isSupportedEditor(curr.$editor, pages[idx].$editor))
return;
// pass in null to mutate the active split view
Splits.mutate(null, pages[idx]);
Splits.update(Splits.getActive());
this.save();
return false;
},
Splits.get(e.page).forEach(function(split) {
if (Splits.isActive(split))
Splits.update(split);
});
_self.save();
if (split.pairs.length > 1) {
if (apf.isTrue(node.getAttribute("active")))
active = split;
if (splits.indexOf(split) == -1)
splits.push(split);
}
}
Splits.set(splits);
if (!active || splits.indexOf(active, activePage) == -1) {
tabs.set(activePage);
}
else if (active) {
//tabs.set(active.pairs[0].page);
Splits.update(active);
Splits.show(active);
mnuSplitAlign.setAttribute("checked", active.gridLayout == "3rows");
if (active.clone)
mnuCloneView.setAttribute("checked", true);
}
if (!restoreQueue.length)
restoring = false;
},
splits.get(e.page).forEach(function(split) {
if (splits.isActive(split))
splits.update(split);
});
_self.save();
fake.setAttribute("model", fake.$model = page.$model);
page.addEventListener("DOMNodeRemovedFromDocument", function(e) {
if (typeof tabEditors == "undefined" || !fake || !fake.parentNode)
return;
tabEditors.remove(fake);
});
Editors.initEditorEvents(fake, page.$model);
Splits.mutate(null, fake);
split = Splits.get(fake)[0];
split.clone = fake;
Splits.update(split);
this.save();
return fake;
},
tabs.addEventListener("tabselectmouseup", function(e) {
var page = this.$activepage;
var split = splits.get(page)[0];
if (split)
splits.update(split);
});
changeLayout: function(page, gridLayout) {
var split = Splits.get(page)[0];
if (!split || split.gridLayout == gridLayout)
return;
Splits.update(split, gridLayout);
mnuSplitAlign.setAttribute("checked", gridLayout == "3rows");
this.save();
},
changeLayout: function(page, gridLayout) {
var split = splits.get(page)[0];
if (!split || split.gridLayout == gridLayout)
return;
splits.update(split, gridLayout);
mnuSplitAlign.setAttribute("checked", gridLayout == "3rows");
this.save();
},
Splits.get(e.page).forEach(function(split) {
if (Splits.isActive(split))
Splits.update(split);
});
_self.save();
tabs.addEventListener("tabselectmouseup", function(e) {
var page = this.$activepage;
var split = Splits.get(page)[0];
if (split)
Splits.update(split);
});