summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.snippets.editor.js
diff options
context:
space:
mode:
authorchm@openerp.com <>2014-04-16 09:46:34 +0200
committerchm@openerp.com <>2014-04-16 09:46:34 +0200
commitdbe1b81d1554ee652a486e70dd4917ac5b0c106e (patch)
tree495064192880bada793d87b604b7fd66ce6b9f87 /addons/website/static/src/js/website.snippets.editor.js
parent9c0526b1bde33922fcf7dddf1e65bf4429b64bff (diff)
parent3755fa19a52481ae2f1c35668ecbf91415200743 (diff)
[MERGE] from trunk
bzr revid: chm@openerp.com-20140416074634-jkcn3ae30q9uqnsi
Diffstat (limited to 'addons/website/static/src/js/website.snippets.editor.js')
-rw-r--r--addons/website/static/src/js/website.snippets.editor.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index 7aa189db653..7865c1f3933 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -435,7 +435,6 @@
// snippet_selectors => to get selector-siblings, selector-children, selector-vertical-children
$snippet = $(this);
$toInsert = $snippet.find('.oe_snippet_body').clone();
- $toInsert.removeClass('oe_snippet_body');
var selector = [];
var selector_siblings = [];
@@ -498,6 +497,8 @@
});
},
stop: function(ev, ui){
+ $toInsert.removeClass('oe_snippet_body');
+
if (action === 'insert' && ! dropped && $('.oe_drop_zone') && ui.position.top > 3) {
var el = $('.oe_drop_zone').nearest({x: ui.position.left, y: ui.position.top}).first();
if (el.length) {
@@ -905,6 +906,7 @@
var self = this;
var bg = self.$target.css("background-image");
this.$el.find('li').removeClass("active");
+ this.$el.find('li').removeClass("btn-primary");
var $active = this.$el.find('li[data-value]')
.filter(function () {
var $li = $(this);
@@ -917,8 +919,13 @@
this.$el.find('li[data-value].oe_custom_bg') :
this.$el.find('li[data-value=""]');
}
- $active.addClass("active");
- this.$el.find('li:has(li[data-value].active)').addClass("active");
+
+ //don't set active on an OpenDialog link, else it not possible to click on it again after.
+ // TODO in Saas-4 - Once bootstrap is in less
+ // - add a class active-style to get the same display but without the active behaviour used by bootstrap in JS.
+ var classStr = _.string.contains($active[0].className, "oe_custom_bg") ? "btn-primary" : "active";
+ $active.addClass(classStr);
+ this.$el.find('li:has(li[data-value].active)').addClass(classStr);
}
});
@@ -934,7 +941,7 @@
drop_and_build_snippet: function() {
this.id = this.unique_id();
this.$target.attr("id", this.id);
- this.$target.find("[data-slide]").attr("data-target", "#" + this.id);
+ this.$target.find("[data-slide]").attr("data-cke-saved-href", "#" + this.id);
this.$target.find("[data-slide-to]").attr("data-target", "#" + this.id);
this.rebind_event();
@@ -1498,7 +1505,9 @@
$(document.body).on("media-saved", self, function (event, prev , item) {
self.editor.onBlur();
self.BuildingBlock.make_active(false);
- self.BuildingBlock.make_active($(item));
+ if (self.$target.parent().data("oe-field") !== "image") {
+ self.BuildingBlock.make_active($(item));
+ }
});
this.$el.find(".edition").click(function (event) {