Reincorporate 8's updates
This commit is contained in:
parent
9dfafe368c
commit
407e70b20c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
global CodeMirror linterConfig loadScript
|
global CodeMirror loadScript
|
||||||
global editors editor styleId ownTabId
|
global editors editor styleId ownTabId
|
||||||
global save toggleStyle setupAutocomplete makeSectionVisible getSectionForChild
|
global save toggleStyle setupAutocomplete makeSectionVisible getSectionForChild
|
||||||
global getSectionsHashes
|
global getSectionsHashes
|
||||||
|
@ -8,9 +8,6 @@ global messageBox
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
onDOMscriptReady('/codemirror.js').then(() => {
|
onDOMscriptReady('/codemirror.js').then(() => {
|
||||||
|
|
||||||
CodeMirror.defaults.lint = linterConfig.getForCodeMirror();
|
|
||||||
|
|
||||||
const COMMANDS = {
|
const COMMANDS = {
|
||||||
save,
|
save,
|
||||||
toggleStyle,
|
toggleStyle,
|
||||||
|
@ -43,6 +40,9 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.defineInitHook(cm => {
|
CodeMirror.defineInitHook(cm => {
|
||||||
|
if (!cm.display.wrapper.closest('#sections')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (prefs.get('editor.livePreview') && styleId) {
|
if (prefs.get('editor.livePreview') && styleId) {
|
||||||
cm.on('changes', updatePreview);
|
cm.on('changes', updatePreview);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user