From e15e6fe32ea94586c3aeb8c32953e03e95b2e544 Mon Sep 17 00:00:00 2001 From: Adrien Dieudonne Date: Fri, 1 Dec 2017 15:14:11 +0100 Subject: [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 --- addons/web_editor/static/src/js/rte.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web_editor/static/src/js') 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'); } }); -- cgit v1.2.3