From 541c1bc95012fccc5e5cd6c5fe63553ea6a7df80 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 11 Sep 2013 15:37:25 +0200 Subject: [PATCH] [FIX] website: editor snippet click to active bzr revid: chm@openerp.com-20130911133725-6ivh2n5wq1ib0a31 --- addons/website/static/src/js/website.snippets.js | 7 +++---- addons/website/static/src/xml/website.snippets.xml | 10 +++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index d2561d73cc9..e7113a19b74 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -83,8 +83,6 @@ var $parent = self.$active_snipped_id.parents("[data-snippet-id]:first"); if ($parent.length) { $target = $parent; - } else if (self.$active_snipped_id.get(0) === $target[0]) { - return; } } } @@ -92,8 +90,8 @@ setTimeout(function () {snipped_event_flag = false;}, 0); self.make_active($target); }); - $("body > :not(:has(#website-top-view)):not(#oe_manipulators)").on('mousedown', function (ev) { - if (!snipped_event_flag) { + $("body > :not(:has(#website-top-view)):not(#oe_manipulators)").on('click', function (ev) { + if (!snipped_event_flag && self.$active_snipped_id && !self.$active_snipped_id.parents("[data-snippet-id]:first")) { self.make_active(false); } }); @@ -665,6 +663,7 @@ $target.find(".carousel-control").attr("href", "#"+id); }, start : function () { + this._super(); var self = this; this.$editor.find(".js_add").on('click', this.on_add); diff --git a/addons/website/static/src/xml/website.snippets.xml b/addons/website/static/src/xml/website.snippets.xml index 3fc1bdb20c8..69a40e9173e 100644 --- a/addons/website/static/src/xml/website.snippets.xml +++ b/addons/website/static/src/xml/website.snippets.xml @@ -17,8 +17,10 @@
-
  • +
  • +
  • +
  • @@ -36,12 +38,18 @@
  • +
  • +
  • +
  • +
  • +
  • +