summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2013-09-20 17:21:40 +0200
committerChristophe Matthieu <chm@openerp.com>2013-09-20 17:21:40 +0200
commit29edb60a6e2015ae9588534b4b95b879d8d7f334 (patch)
treeff30b73cf0ad8ad08545c883e83ce575f55fd29c /addons/website/static/src
parent691aace187c2ee6561c6c3453709c917505d1de9 (diff)
[IMP] website editor: bounce and edit function of [data-oe-model]
bzr revid: chm@openerp.com-20130920152140-3180je9nhnxw7x2p
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/website.snippets.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js
index 7defd7b32ad..3457fbb66e2 100644
--- a/addons/website/static/src/js/website.snippets.js
+++ b/addons/website/static/src/js/website.snippets.js
@@ -7,7 +7,7 @@
website.EditorBar.include({
start: function () {
var self = this;
- $("body").on('click', function (event) {
+ $("[data-oe-model]").on('click', function (event) {
var tag = event.srcElement.tagName.toLowerCase();
var $this = $(event.srcElement);
if (!(tag === 'a' || tag === "button") && !$this.parents("a, button").length) {
@@ -86,19 +86,19 @@
},
dom_filter: function (dom) {
if (typeof dom === "string") {
- var exclude = ":not(#oe_manipulators):not(#website-top-navbar):not(.oe_snippet)";
+ var include = "[data-oe-model]";
var sdom = dom.split(',');
dom = "";
_.each(sdom, function (val) {
val = val.replace(/^\s+|\s+$/g, '');
- dom += "body > " + exclude + " " + val + ", ";
+ dom += "body " + include + " " + val + ", ";
val = val.split(" ");
- dom += "body > "+ val.shift() + exclude + val.join(" ") + ", ";
+ dom += "body "+ val.shift() + include + val.join(" ") + ", ";
});
dom = dom.replace(/,\s*$/g, '');
return $(dom);
} else {
- return $(dom).parents("#oe_manipulators, #website-top-navbar").length || $(dom).hasClass("oe_snippet") ? $("") : $(dom);
+ return $(dom).is("[data-oe-model]") || $(dom).parents("[data-oe-model]").length ? $(dom) : $("");
}
},
start: function() {
@@ -208,7 +208,7 @@
}
self.make_active($target);
});
- $("body > :not(:has(#website-top-view)):not(#oe_manipulators)").on('click', function (ev) {
+ $("[data-oe-model]").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);
}