Editor: sticky .CodeMirror-active class for code boxes
It is retained when a child search/jump minidialog is focused unlike the built-in .CodeMirror-focused
This commit is contained in:
parent
5f9a4d6172
commit
7ca69e61da
10
edit.js
10
edit.js
|
@ -310,8 +310,16 @@ function setupCodeMirror(textarea, index) {
|
|||
cm.on("blur", function(cm) {
|
||||
editors.lastActive = cm;
|
||||
hotkeyRerouter.setState(true);
|
||||
setTimeout(function() {
|
||||
var cm = editors.lastActive;
|
||||
var childFocused = cm.display.wrapper.contains(document.activeElement);
|
||||
cm.display.wrapper.classList.toggle("CodeMirror-active", childFocused);
|
||||
}, 0);
|
||||
});
|
||||
cm.on("focus", function() {
|
||||
hotkeyRerouter.setState(false);
|
||||
cm.display.wrapper.classList.add("CodeMirror-active");
|
||||
});
|
||||
cm.on("focus", hotkeyRerouter.setState.bind(null, false));
|
||||
|
||||
var resizeGrip = cm.display.wrapper.appendChild(document.createElement("div"));
|
||||
resizeGrip.className = "resize-grip";
|
||||
|
|
Loading…
Reference in New Issue
Block a user