From 1c4e6c87a0b7705679fe1d12c6a0098cbe8a97fb Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 21 Jan 2015 17:23:50 +0100 Subject: [PATCH] [FIX] website editor: resize snippet loose the focus --- addons/website/static/src/js/website.snippets.editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index bc426476a62..b44b95300a3 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -378,7 +378,7 @@ var snipped_event_flag; $(document).on('click', '*', function (event) { var srcElement = event.srcElement || (event.originalEvent && (event.originalEvent.originalTarget || event.originalEvent.target) || event.target); - if (snipped_event_flag===srcElement || !srcElement) { + if (self.editor_busy || snipped_event_flag===srcElement || !srcElement) { return; } snipped_event_flag = srcElement; @@ -1396,7 +1396,9 @@ $body.unbind('mousemove', body_mousemove); $body.unbind('mouseup', body_mouseup); $body.removeClass(cursor); - self.BuildingBlock.editor_busy = false; + setTimeout(function () { + self.BuildingBlock.editor_busy = false; + },0); self.$target.removeClass("resize_editor_busy"); }; $body.mousemove(body_mousemove);