summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2014-10-02 10:13:29 +0200
committerOlivier Dony <odo@openerp.com>2014-10-02 10:27:30 +0200
commitc76297c4f832a759c3057589dcaa0bd67c24e69f (patch)
tree6df4dbfdc57c63376936bdcdfee5eafefa1ca38d /addons/website/static/src/js/website.editor.js
parentf8d5a6727d3e8d428d9bef93da7ba6b11f344284 (diff)
[FIX] website: editor: ignore spurious changes for editable content
Changes to contentEditable or attributeEditable attributes should not cause the corresponding section to be marked as dirty (oe_dirty). This would otherwise cause an extra editor save() for those, wrongly marking untouched templates as `noupdate`, and possibly triggering access right errors.
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 82888c5d8a3..6d151dc1008 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -1924,9 +1924,10 @@
return false;
}
switch(m.type) {
- case 'attributes': // ignore .cke_focus being added or removed
- // ignore id modification
- if (m.attributeName === 'id') { return false; }
+ case 'attributes':
+ // ignore special attributes and .cke_focus class being added or removed
+ var ignored_attrs = ['id', 'contenteditable', 'attributeeditable']
+ if (_.contains(ignored_attrs, m.attributeName)) { return false; }
// if attribute is not a class, can't be .cke_focus change
if (m.attributeName !== 'class') { return true; }