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;
|
var clickedSection = event.target.parentNode;
|
||||||
sections.insertBefore(div, clickedSection.nextElementSibling);
|
sections.insertBefore(div, clickedSection.nextElementSibling);
|
||||||
var newIndex = document.querySelectorAll("#sections > div").indexOf(clickedSection) + 1;
|
var newIndex = document.querySelectorAll("#sections > div").indexOf(clickedSection) + 1;
|
||||||
setupCodeMirror(codeElement, newIndex).focus();
|
var cm = setupCodeMirror(codeElement, newIndex);
|
||||||
|
makeSectionVisible(cm);
|
||||||
|
cm.focus()
|
||||||
} else {
|
} else {
|
||||||
sections.appendChild(div);
|
sections.appendChild(div);
|
||||||
setupCodeMirror(codeElement);
|
setupCodeMirror(codeElement);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user