From 5a4c8998e7c04291927aadbb349b573d63d19203 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 29 Jul 2015 14:28:40 +0200 Subject: [FIX] web_editor: _.find break if the value is a space Some classes are not checked. Compact values to remove empty string classes. --- addons/web_editor/static/src/js/transcoder.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web_editor/static/src/js/transcoder.js') diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 9188bfabb45..6e0097ee8fb 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -137,6 +137,7 @@ var style_to_class = function ($editable) { $editable.find("[class]").each(function () { classes = classes.concat(this.className.split(/\s+/)); }); + classes = _.compact(classes); var maybe_selector = _.filter(rulesCache, function (a) { return !!_.find(classes, function (b) { return a.selector.indexOf("."+b) !== -1; } ); }); var selector = _.map(maybe_selector, function (a) { return a.selector;}).join(","); -- cgit v1.2.3