[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
This commit is contained in:
@@ -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, ' ');
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user