diff options
| author | Adrien Dieudonne <adr@odoo.com> | 2017-12-01 15:14:11 +0100 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2017-12-04 09:24:35 +0100 |
| commit | e15e6fe32ea94586c3aeb8c32953e03e95b2e544 (patch) | |
| tree | 79ee17204c6ff5267ad3843d19443e333ad90b45 /addons/web_editor | |
| parent | 19fda52a531517c2cbaeb7ee956a08d6b771ef25 (diff) | |
[FIX] web_editor: support of SVG elements in snippets
Before this commit, it was not possible to save a page
containing a snippet with a SVG tag.
To support SVG elements, we need to use 'Element.getAttribute'
and 'Element.setAttribute' as mentionned in the documentation:
https://developer.mozilla.org/en-US/docs/Web/API/Element/className
For more information, see GH-14485
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/rte.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index 37b87553506..c3a88007542 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -364,8 +364,8 @@ var RTE = Widget.extend({ var $el = $(this); $el.find('[class]').filter(function () { - if (!this.className.match(/\S/)) { - this.removeAttribute("class"); + if (!this.getAttribute('class').match(/\S/)) { + this.removeAttribute('class'); } }); |
