From d12974eee38d7560dedd234a9b6ee9ae891fffdb Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 19 Aug 2014 16:19:53 +0200 Subject: [FIX] website.snippet: can't edit website with firefox; remove firefox attr for media video is edit mode --- addons/website/static/src/js/website.snippets.editor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'addons/website/static/src/js/website.snippets.editor.js') diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 16304f95d01..8d7b7f1d5b2 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -321,13 +321,14 @@ var self = this; var snipped_event_flag; $("#wrapwrap").on('click', function (event) { - if (snipped_event_flag || !event.srcElement) { + var srcElement = event.srcElement || (event.originalEvent && (event.originalEvent.originalTarget || event.originalEvent.target)); + if (snipped_event_flag || !srcElement) { return; } snipped_event_flag = true; setTimeout(function () {snipped_event_flag = false;}, 0); - var $target = $(event.srcElement); + var $target = $(srcElement); if ($target.parents(".oe_overlay").length) { return; @@ -1537,6 +1538,9 @@ new website.editor.MediaDialog(self, self.element).appendTo(document.body); self.BuildingBlock.make_active(false); } + setTimeout(function () { + self.$target.find(".css_editable_mode_display").removeAttr("_moz_abspos"); + },0); }, }); -- cgit v1.2.3 From 37c4bd96c144aac66eede7e9f0b296399b3f854c Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 19 Aug 2014 17:00:19 +0200 Subject: [FIX] website.snippet: before the save of the view clean_for_save is called. The option marginAndResize (called by twitter) try to bind events on the overlay but the builder don't load the overlay (for time perf). The fix set a default jquery empty div to avoid the error. --- addons/website/static/src/js/website.snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js/website.snippets.editor.js') diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 8d7b7f1d5b2..b6e3919b9d4 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -741,7 +741,7 @@ var styles = this.$target.data("snippet-option-ids") || {}; styles[snippet_id] = this; this.$target.data("snippet-option-ids", styles); - this.$overlay = this.$target.data('overlay'); + this.$overlay = this.$target.data('overlay') || $('
'); this['snippet-option-id'] = snippet_id; var $option = website.snippet.templateOptions[snippet_id].$el; this.$el = $option.find(">li").clone(); -- cgit v1.2.3