Editor: make newly added section visible
This commit is contained in:
parent
b6444c86ec
commit
62ec9e1c9e
4
edit.js
4
edit.js
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user