summaryrefslogtreecommitdiff
path: root/addons/website
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2015-06-15 13:19:18 +0200
committerXavier Morel <xmo@odoo.com>2015-06-17 11:12:58 +0200
commit77eca089d1697f1bbf7b5df32530f0bd9719eaab (patch)
tree4eea8533a731883306612c41d1777f835da5c5da /addons/website
parent128a3be1929f352ce1c31e8b8bb78645598838d2 (diff)
[FIX] website editor clear()
Apparently in some unclear situations, using delete on the dataset blows up (issue appears in both Safari and phantomjs) failing the test. Only try the deletion if the item is actually present in the dataset, and wrap it in a try/except to handle it blowing up
Diffstat (limited to 'addons/website')
-rw-r--r--addons/website/static/src/js/website.editor.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 5e12647a63a..efe6d293f79 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -2512,7 +2512,14 @@ var VideoDialog = Widget.extend({
this.media = $iframe[0];
},
clear: function () {
- delete this.media.dataset.src;
+ if (this.media.dataset.src) {
+ try {
+ delete this.media.dataset.src;
+ } catch(e) {
+ this.media.dataset.src = undefined;
+ }
+ }
+
this.media.className = this.media.className.replace(/(^|\s)media_iframe_video(\s|$)/g, ' ');
},
});