From fc20479ab435118b70970ef02b7574539b3b6040 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 22 Nov 2017 02:54:25 +0300 Subject: [PATCH] correctly unhook colorpicker in usercss#stylus mode --- vendor-overwrites/colorpicker/colorview.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index ed149897..1a5c1879 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -64,9 +64,11 @@ } function unregisterHooks() { - const mx = CodeMirror.modeExtensions.css; - if (mx && mx.token === colorizeToken) { - delete mx.token; + for (const name in CodeMirror.modeExtensions) { + const mx = CodeMirror.modeExtensions[name]; + if (mx && mx.token === colorizeToken) { + delete mx.token; + } } }