summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2013-09-11 15:37:25 +0200
committerChristophe Matthieu <chm@openerp.com>2013-09-11 15:37:25 +0200
commit541c1bc95012fccc5e5cd6c5fe63553ea6a7df80 (patch)
tree59feeddb399e8964359fc65b557669c06fc5a2e3
parent134c0899541f036d38885c76771c4a55650a4a5d (diff)
[FIX] website: editor snippet click to active
bzr revid: chm@openerp.com-20130911133725-6ivh2n5wq1ib0a31
-rw-r--r--addons/website/static/src/js/website.snippets.js7
-rw-r--r--addons/website/static/src/xml/website.snippets.xml10
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 @@
<div t-name="website.snippets.container" data-snippet-id='container'>
<!-- editor bar to display inside the top edit bar -->
- <li class='oe_snippet_options box_resize'>
+ <li class='oe_snippet_options'>
<a href="#" class="button js_box_move"><i class='icon icon-move'></i></a>
+ </li>
+ <li class='oe_snippet_options'>
<a href="#" class="button js_box_remove"><i class="icon icon-remove"></i></a>
</li>
@@ -36,12 +38,18 @@
<!-- editor bar to display inside the top edit bar -->
<li class='oe_snippet_options'>
<a href="#" class="button js_add"><i class="icon icon-plus-sign"></i></a>
+ </li>
+ <li class='oe_snippet_options'>
<a href="#" class="button js_remove"><i class="icon icon-minus-sign"></i></a>
+ </li>
+ <li class='oe_snippet_options'>
<select name="carousel-background">
<option value="/website/static/src/img/greenfields.jpg">greenfields</option>
<option value="/website/static/src/img/landscape.png">landscape</option>
<option value="/website/static/src/img/aqua.jpg">aqua</option>
</select>
+ </li>
+ <li class='oe_snippet_options'>
<select name="carousel-style">
<option value="no_image">No image</option>
<option value="image_left">Image left</option>