Fix: handle editor.options.expanded
This commit is contained in:
parent
bb508b6933
commit
b69b834949
19
edit/edit.js
19
edit/edit.js
|
@ -1313,6 +1313,16 @@ function initWithSectionStyle({style, codeIsUpdated}) {
|
|||
}
|
||||
}
|
||||
|
||||
function setupOptionsExpand() {
|
||||
$('#options').open = prefs.get('editor.options.expanded');
|
||||
$('#options h2').addEventListener('click', () => {
|
||||
setTimeout(() => prefs.set('editor.options.expanded', $('#options').open));
|
||||
});
|
||||
prefs.subscribe(['editor.options.expanded'], (key, value) => {
|
||||
$('#options').open = value;
|
||||
});
|
||||
}
|
||||
|
||||
function initHooks() {
|
||||
if (initHooks.alreadyDone) {
|
||||
return;
|
||||
|
@ -1332,14 +1342,7 @@ function initHooks() {
|
|||
$('#keyMap-help').addEventListener('click', showKeyMapHelp, false);
|
||||
$('#cancel-button').addEventListener('click', goBackToManage);
|
||||
|
||||
$('#options').open = prefs.get('editor.options.expanded');
|
||||
$('#options h2').addEventListener('click', () => {
|
||||
setTimeout(() => prefs.set('editor.options.expanded', $('#options').open));
|
||||
});
|
||||
prefs.subscribe(['editor.options.expanded'], (key, value) => {
|
||||
$('#options').open = value;
|
||||
});
|
||||
|
||||
setupOptionsExpand();
|
||||
initLint();
|
||||
|
||||
if (!FIREFOX) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* global CodeMirror dirtyReporter initLint beautify showKeyMapHelp */
|
||||
/* global showToggleStyleHelp goBackToManage updateLintReportIfEnabled */
|
||||
/* global hotkeyRerouter setupAutocomplete */
|
||||
/* global hotkeyRerouter setupAutocomplete setupOptionsExpand */
|
||||
/* global editors */
|
||||
|
||||
'use strict';
|
||||
|
@ -20,6 +20,8 @@ function createSourceEditor(style) {
|
|||
]})
|
||||
);
|
||||
|
||||
setupOptionsExpand();
|
||||
|
||||
// draw CodeMirror
|
||||
$('#sections textarea').value = style.sourceCode;
|
||||
const cm = CodeMirror.fromTextArea($('#sections textarea'));
|
||||
|
|
Loading…
Reference in New Issue
Block a user