open editor a bit faster, fixup <select> bug and widget style

This commit is contained in:
tophf 2017-12-11 08:59:47 +03:00
parent 1b19cc0cf6
commit 3a82a66954
3 changed files with 9 additions and 5 deletions

View File

@ -130,7 +130,7 @@ function createAppliesToLineWidget(cm) {
chrome.runtime.onMessage.addListener(onRuntimeMessage);
updateWidgetStyle();
requestAnimationFrame(updateWidgetStyle);
update();
}

View File

@ -48,16 +48,22 @@ onDOMscriptReady('/codemirror.js').then(() => {
// cm.state.search for last used 'find'
let searchState;
onDOMready().then(() => {
new MutationObserver((mutations, observer) => {
if (!$('#sections')) {
return;
}
observer.disconnect();
prefs.subscribe(['editor.keyMap'], showKeyInSaveButtonTooltip);
showKeyInSaveButtonTooltip();
// N.B. the event listener should be registered before setupLivePrefs()
$('#options').addEventListener('change', onOptionElementChanged);
buildOptionsElements();
setupLivePrefs();
rerouteHotkeys(true);
});
}).observe(document, {childList: true, subtree: true});
return;

View File

@ -32,8 +32,6 @@ Promise.all([
onDOMready(),
])
.then(([style]) => {
setupLivePrefs();
const usercss = isUsercss(style);
$('#heading').textContent = t(styleId ? 'editStyleHeading' : 'addStyleTitle');
$('#name').placeholder = t(usercss ? 'usercssEditorNamePlaceholder' : 'styleMissingName');