correctly unhook colorpicker in usercss#stylus mode

This commit is contained in:
tophf 2017-11-22 02:54:25 +03:00
parent 2c82cc3bbc
commit fc20479ab4

View File

@ -64,11 +64,13 @@
} }
function unregisterHooks() { function unregisterHooks() {
const mx = CodeMirror.modeExtensions.css; for (const name in CodeMirror.modeExtensions) {
const mx = CodeMirror.modeExtensions[name];
if (mx && mx.token === colorizeToken) { if (mx && mx.token === colorizeToken) {
delete mx.token; delete mx.token;
} }
} }
}
function resetMode(cm) { function resetMode(cm) {
cm.setOption('mode', cm.getMode().name); cm.setOption('mode', cm.getMode().name);