[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
This commit is contained in:
Adrien Dieudonne
2017-12-04 09:24:35 +01:00
parent 19fda52a53
commit e15e6fe32e
+2 -2
View File
@@ -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');
}
});