From ce1ff0a85487bca3ef072abe6ba0c777335d3855 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 28 Feb 2014 14:17:38 +0100 Subject: [PATCH] [FIX] website snippet: Fix parallax with retro-compatibility; Crappy fix for carousel because bootstrap active cycling when user click on a bullet and don't stop when user edit a snippet inside a slider. bzr revid: chm@openerp.com-20140228131738-il41640r8x9zesll --- addons/website/static/src/css/website.css | 19 ++++++----------- addons/website/static/src/css/website.sass | 21 +++++++------------ .../static/src/js/website.snippets.editor.js | 15 ++++++------- addons/website/views/snippets.xml | 10 ++++----- 4 files changed, 24 insertions(+), 41 deletions(-) diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index db0aff3b01a..81b40ce7aca 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -394,22 +394,15 @@ div.carousel[data-snippet-id="slider"] .carousel-indicators .active { } .parallax { - position: relative; background-size: cover; - display: table; - width: 100%; - min-height: 100px; -} -.parallax.oe_small { - min-height: 200px; -} -.parallax.oe_medium { - min-height: 300px; -} -.parallax.oe_big { - min-height: 450px; } .parallax > div { + position: relative; + display: table; + width: 100%; + min-height: 200px; +} +.parallax > div > div { display: table-cell; vertical-align: middle; padding: 32px 0; diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 907b0615c0e..a9ae82cee3a 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -324,21 +324,16 @@ div.carousel[data-snippet-id="slider"] background-color: grey .parallax - position: relative background-size: cover - display: table - width: 100% - min-height: 100px - &.oe_small - min-height: 200px - &.oe_medium - min-height: 300px - &.oe_big - min-height: 450px > div - display: table-cell - vertical-align: middle - padding: 32px 0 + position: relative + display: table + width: 100% + min-height: 200px + > div + display: table-cell + vertical-align: middle + padding: 32px 0 /* Background */ diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 8414196b696..41b198fddec 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -25,6 +25,8 @@ this.on('rte:ready', this, function () { self.snippets.$button.removeClass("hidden"); website.snippet.start_animation(); + // force to unactive slider cycling + setInterval(function () {$(".carousel").carousel("pause");},3000); }); return this._super.apply(this, arguments); @@ -1304,14 +1306,6 @@ this.$target.find(".item:first").addClass("active"); } }, - onFocus : function () { - this._super(); - this.$target.carousel('pause'); - }, - onBlur : function () { - this._super(); - this.$target.carousel('cycle'); - }, start : function () { var self = this; this._super(); @@ -1464,7 +1458,10 @@ self.$target.data("snippet-view").set_values(); }); this.$target.attr('contentEditable', 'false'); - this.$target.find('> div > .oe_structure').attr('contentEditable', 'true'); + + this.$target.find('> div > .oe_structure').attr('contentEditable', 'true'); // saas-3 retro-compatibility + + this.$target.find('> div > div:not(.oe_structure) > .oe_structure').attr('contentEditable', 'true'); }, scroll: function () { var self = this; diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index 11d01176da0..ff3d65dc459 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -792,7 +792,7 @@
@@ -804,10 +804,9 @@ Parallax Slider
-
-
+
-
-
+