diff options
| author | Christophe Matthieu <chm@odoo.com> | 2016-07-19 11:13:58 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2016-09-05 17:00:09 +0100 |
| commit | 0cca5651a518c5dc80de34490c082b1528dc5f5a (patch) | |
| tree | e92e5bb446a424c817a24d38914d8ccd38198aa8 /addons/web_editor/static/src/js/transcoder.js | |
| parent | 8fc60d35097d9fc639f6dfec8007032b2054d9c9 (diff) | |
[FIX] web_editor: saved mass_mailing have small difference with edition
Diffstat (limited to 'addons/web_editor/static/src/js/transcoder.js')
| -rw-r--r-- | addons/web_editor/static/src/js/transcoder.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 89831d35d50..dd1a6a498b3 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -72,11 +72,11 @@ var getMatchedCSSRules = function (a) { function specificity (selector) { // http://www.w3.org/TR/css3-selectors/#specificity var a = 0; - selector.replace(/#[a-z0-9_-]+/gi, function () { a++; return ""; }); + selector = selector.replace(/#[a-z0-9_-]+/gi, function () { a++; return ""; }); var b = 0; - selector.replace(/(\.[a-z0-9_-]+)|(\[.*?\])/gi, function () { b++; return ""; }); + selector = selector.replace(/(\.[a-z0-9_-]+)|(\[.*?\])/gi, function () { b++; return ""; }); var c = 0; - selector.replace(/(\s+|:+)[a-z0-9_-]+/gi, function (a) { if(a.indexOf(':not(')===-1) c++; return ""; }); + selector = selector.replace(/(^|\s+|:+)[a-z0-9_-]+/gi, function (a) { if(a.indexOf(':not(')===-1) c++; return ""; }); return a*100 + b*10 + c; } css.sort(function (a, b) { return specificity(a[0]) - specificity(b[0]); }); |
