Edit style: fix goto next/prev section after deleting one

This commit is contained in:
tophf 2015-03-08 07:42:55 +03:00
parent 556c8746f6
commit 8844b71aab

View File

@ -177,7 +177,12 @@ function removeAppliesTo(event) {
} }
function removeSection(event) { function removeSection(event) {
event.target.parentNode.parentNode.removeChild(event.target.parentNode); var section = event.target.parentNode;
var cm = section.querySelector(".CodeMirror-wrap");
if (cm && editors.indexOf(cm.CodeMirror) >= 0) {
editors.splice(editors.indexOf(cm.CodeMirror), 1);
}
section.parentNode.removeChild(section);
makeDirty(); makeDirty();
} }