Editor: make newly added section visible

This commit is contained in:
tophf 2015-04-22 23:47:29 +03:00
parent b6444c86ec
commit 62ec9e1c9e

View File

@ -426,7 +426,9 @@ function addSection(event, section) {
var clickedSection = event.target.parentNode;
sections.insertBefore(div, clickedSection.nextElementSibling);
var newIndex = document.querySelectorAll("#sections > div").indexOf(clickedSection) + 1;
setupCodeMirror(codeElement, newIndex).focus();
var cm = setupCodeMirror(codeElement, newIndex);
makeSectionVisible(cm);
cm.focus()
} else {
sections.appendChild(div);
setupCodeMirror(codeElement);