diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-08-24 18:19:19 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-08-24 18:19:19 +0200 |
| commit | 88c0ce0692ccf3b1302e15c4ebe34dbf2040be40 (patch) | |
| tree | 5bb1749f69f96df22a92a747052dc2965e83430e /addons/website/static/src/js/website.snippets.editor.js | |
| parent | 878c3c9291ad69b530d24227cb25b38dbf10229b (diff) | |
| parent | e16d495d8965522d90ddf5d5da234b1650a695f9 (diff) | |
[MERGE] forward port of branch saas-6 up to e16d495
Diffstat (limited to 'addons/website/static/src/js/website.snippets.editor.js')
| -rw-r--r-- | addons/website/static/src/js/website.snippets.editor.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 9cc40247b89..61a7622ecbf 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -81,7 +81,7 @@ options.registry.slider = options.Class.extend({ this.$indicators.append('<li data-target="#' + this.id + '" data-slide-to="' + cycle + '"></li>'); // clone the best candidate from template to use new features - var $snippets = this.BuildingBlock.$snippets; + var $snippets = this.buildingBlock.$snippets; //since saas-6, all snippets must start by s_ var selection = this.$target.closest('[class*="s_"'); if (_.isUndefined(selection)) { @@ -174,7 +174,7 @@ options.registry.carousel = options.registry.slider.extend({ }; this.$target.on('slid.bs.carousel', function () { if(self.editor && self.editor.styles.background) { - self.editor.styles.background.$bg = self.$target.find(".item.active"); + self.editor.styles.background.$target = self.$target.find(".item.active"); self.editor.styles.background.set_active(); } self.$target.carousel("pause"); @@ -264,9 +264,13 @@ options.registry.marginAndResize = options.Class.extend({ } else { var xy = event['page'+XY]; var current = resize[2] || 0; + var margin_dir = {s:'bottom', n: 'top', w: 'left', e: 'right'}[compass]; + var real_margin = parseInt(self.$target.css('margin-'+margin_dir)); _.each(resize[0], function (val, key) { if (self.$target.hasClass(val)) { current = key; + } else if (resize[1][key] === real_margin) { + current = key; } }); var begin = current; @@ -362,12 +366,12 @@ options.registry.marginAndResize = options.Class.extend({ if (offset === 0) overlay_class+= " block-w-left"; var mb = _class.match(/mb([0-9-]+)/i); - mb = mb ? +mb[1] : 0; + mb = mb ? +mb[1] : parseInt(this.$target.css('margin-bottom')); if (mb >= 128) overlay_class+= " block-s-bottom"; else if (!mb) overlay_class+= " block-s-top"; var mt = _class.match(/mt([0-9-]+)/i); - mt = mt ? +mt[1] : 0; + mt = mt ? +mt[1] : parseInt(this.$target.css('margin-top')); if (mt >= 128) overlay_class+= " block-n-top"; else if (!mt) overlay_class+= " block-n-bottom"; |
