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,9 +64,11 @@
} }
function unregisterHooks() { function unregisterHooks() {
const mx = CodeMirror.modeExtensions.css; for (const name in CodeMirror.modeExtensions) {
if (mx && mx.token === colorizeToken) { const mx = CodeMirror.modeExtensions[name];
delete mx.token; if (mx && mx.token === colorizeToken) {
delete mx.token;
}
} }
} }