summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-07-29 14:28:40 +0200
committerChristophe Matthieu <chm@odoo.com>2015-07-31 10:08:58 +0200
commit5a4c8998e7c04291927aadbb349b573d63d19203 (patch)
treecdd76e7349cb82564fe6cb66d9666d1b5e1ebe05 /addons/web_editor/static/src
parent374436bff8758a48e4fd44179c3821eb6688073c (diff)
[FIX] web_editor: _.find break if the value is a space
Some classes are not checked. Compact values to remove empty string classes.
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/transcoder.js1
1 files changed, 1 insertions, 0 deletions
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(",");