summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2016-02-04 16:45:19 +0100
committerNicolas Lempereur <nle@odoo.com>2016-02-04 16:50:22 +0100
commit7c11d4e70f3a70c8ba0204c3a69cd6c96a4e9700 (patch)
treeecc7298689282db587ecb52584df9064ed530ecb /addons/web_editor/static/src
parent9c594cb3cd2fff63c8f7ccfb3aea4be743fc2bd6 (diff)
[FIX] web_editor: minor tweaks IE11
In IE11 the values can be not string (for example a number and so not have .indexOf method), but then there will no be !important bits and we can just ignore this feature (which check if an overriding rule has an !important flag). There was another edge case when getting a "" set style, we get undefined. opw-667917
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/transcoder.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js
index 4b613ba636c..14461ba1cf6 100644
--- a/addons/web_editor/static/src/js/transcoder.js
+++ b/addons/web_editor/static/src/js/transcoder.js
@@ -84,7 +84,7 @@ var getMatchedCSSRules = function (a) {
var style = {};
_.each(css, function (v,k) {
_.each(v[1], function (v,k) {
- if (v && k.indexOf('-webkit') === -1 && (!style[k] || style[k].indexOf('important') === -1 || v.indexOf('important') !== -1)) {
+ if (v && _.isString(v) && k.indexOf('-webkit') === -1 && (!style[k] || style[k].indexOf('important') === -1 || v.indexOf('important') !== -1)) {
style[k] = v;
}
});
@@ -195,7 +195,7 @@ var style_to_class = function ($editable) {
style = k+":"+v+";"+style;
}
});
- css = $c.attr("style", style).attr("style").split(/\s*;\s*/);
+ css = ($c.attr("style", style).attr("style") || "").split(/\s*;\s*/);
style = $target.attr("style") || "";
_.each(css, function (v) {
style = style.replace(v, '');