summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/content/snippets.animation.js20
-rw-r--r--addons/website/static/src/js/editor/snippets.options.js35
-rw-r--r--addons/website/static/src/less/website.snippets.less3
3 files changed, 39 insertions, 19 deletions
diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js
index 3556ebd8fc7..d7c29359b95 100644
--- a/addons/website/static/src/js/content/snippets.animation.js
+++ b/addons/website/static/src/js/content/snippets.animation.js
@@ -431,6 +431,23 @@ registry.slider = Animation.extend({
* @override
*/
start: function () {
+ if (!this.editableMode) {
+ var maxHeight = 0;
+ var $items = this.$('.item');
+ _.each($items, function (el) {
+ var $item = $(el);
+ var isActive = $item.hasClass('active');
+ $item.addClass('active');
+ var height = $item.outerHeight();
+ if (height > maxHeight) {
+ maxHeight = height;
+ }
+ $item.toggleClass('active', isActive);
+ });
+ _.each($items, function (el) {
+ $(el).css('min-height', maxHeight);
+ });
+ }
this.$target.carousel();
return this._super.apply(this, arguments);
},
@@ -441,6 +458,9 @@ registry.slider = Animation.extend({
this._super.apply(this, arguments);
this.$target.carousel('pause');
this.$target.removeData('bs.carousel');
+ _.each(this.$('.item'), function (el) {
+ $(el).css('min-height', '');
+ });
},
});
diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js
index e0dced9caa1..7601dea6b6c 100644
--- a/addons/website/static/src/js/editor/snippets.options.js
+++ b/addons/website/static/src/js/editor/snippets.options.js
@@ -122,12 +122,11 @@ options.registry.carousel = options.Class.extend({
this.$target.on('slid.bs.carousel', function () {
self.$target.carousel('pause');
self.trigger_up('option_update', {
- optionNames: ['background', 'background_position', 'colorpicker'],
+ optionNames: ['background', 'background_position', 'colorpicker', 'sizing_y'],
name: 'target',
data: self.$target.find('.item.active'),
});
});
- this.$target.trigger('slid.bs.carousel');
return def;
},
@@ -144,6 +143,14 @@ options.registry.carousel = options.Class.extend({
this._rebindEvents();
},
/**
+ * @override
+ */
+ onFocus: function () {
+ // Needs to be done on focus, not on start, as all other options are
+ // maybe not all initialized in start
+ this.$target.trigger('slid.bs.carousel');
+ },
+ /**
* Associates unique ID on cloned slider elements.
*
* @override
@@ -161,7 +168,7 @@ options.registry.carousel = options.Class.extend({
this._super.apply(this, arguments);
this.$target.find('.item').removeClass('next prev left right active')
.first().addClass('active');
- this.$target.find('.carousel-indicators').find('li').removeClass('active')
+ this.$target.find('.carousel-indicators').find('li').removeClass('active').html('')
.first().addClass('active');
this.$target.removeClass('oe_img_bg ' + this._class).css('background-image', '');
},
@@ -262,9 +269,7 @@ options.registry.carousel = options.Class.extend({
},
});
-options.registry['margin-x'] = options.registry.marginAndResize.extend({
- preventChildPropagation: true,
-
+options.registry.sizing_x = options.registry.sizing.extend({
/**
* @override
*/
@@ -286,15 +291,13 @@ options.registry['margin-x'] = options.registry.marginAndResize.extend({
* @override
*/
_getSize: function () {
- this.grid = this._super();
- var width = this.$target.parents('.row:first').first().outerWidth();
-
- var grid = [1,2,3,4,5,6,7,8,9,10,11,12];
- this.grid.e = [_.map(grid, function (v) {return 'col-md-'+v;}), _.map(grid, function (v) {return width/12*v;})];
-
- grid = [-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11];
- this.grid.w = [_.map(grid, function (v) {return 'col-md-offset-'+v;}), _.map(grid, function (v) {return width/12*v;}), 12];
-
+ var width = this.$target.closest('.row').width();
+ var gridE = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ var gridW = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
+ this.grid = {
+ e: [_.map(gridE, function (v) { return 'col-md-' + v; }), _.map(gridE, function (v) { return width/12*v; }), 'width'],
+ w: [_.map(gridW, function (v) { return 'col-md-offset-' + v; }), _.map(gridW, function (v) { return width/12*v; }), 'margin-left'],
+ };
return this.grid;
},
/**
@@ -321,7 +324,7 @@ options.registry['margin-x'] = options.registry.marginAndResize.extend({
this.$target.addClass('col-md-offset-' + offset);
}
}
- this._super(compass, beginClass, current);
+ this._super.apply(this, arguments);
},
});
diff --git a/addons/website/static/src/less/website.snippets.less b/addons/website/static/src/less/website.snippets.less
index 59cbc47b9dc..388a7180d96 100644
--- a/addons/website/static/src/less/website.snippets.less
+++ b/addons/website/static/src/less/website.snippets.less
@@ -436,9 +436,6 @@ div.carousel {
background-attachment: fixed;
}
}
-.s_parallax {
- min-height: 200px;
-}
// Company Team