Skip to content
Snippets Groups Projects
Commit 5a4c8998 authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

[FIX] web_editor: _.find break if the value is a space

Some classes are not checked. Compact values to remove empty string classes.
parent 374436bf
No related branches found
No related tags found
No related merge requests found
......@@ -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(",");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment