From ba0778922cf141336c456e3d00e6a0f9de3a41a4 Mon Sep 17 00:00:00 2001
From: "RGA(OpenERP)" <>
Date: Fri, 18 Oct 2013 15:01:35 +0530
Subject: [PATCH 01/58] [IMP] parallax snippet add size option like banner has
bzr revid: rgaopenerp-20131018093135-4ux25wdnd73wlah2
---
addons/website/static/src/css/website.css | 13 +++++++--
addons/website/static/src/css/website.sass | 9 ++++--
.../website/static/src/js/website.snippets.js | 29 +++++++++++++++++++
addons/website/views/snippets.xml | 18 +++++++++++-
4 files changed, 63 insertions(+), 6 deletions(-)
diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css
index ce87e592136..b17249dce64 100644
--- a/addons/website/static/src/css/website.css
+++ b/addons/website/static/src/css/website.css
@@ -1,4 +1,3 @@
-@charset "utf-8";
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
*
* css for editor buttons, openerp widget included in the website and other
@@ -361,11 +360,19 @@ footer {
}
.parallax_full {
- background: #eeeeee bottom center repeat fixed;
- min-height: 650px;
+ background: #eeeeee no-repeat top center;
width: 100%;
background-size: 100%;
}
+.parallax_full.oe_small .container {
+ height: 200px;
+}
+.parallax_full.oe_medium .container {
+ height: 300px;
+}
+.parallax_full.oe_big .container {
+ height: 450px;
+}
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal {
diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass
index 5197653429c..136e039bc1c 100644
--- a/addons/website/static/src/css/website.sass
+++ b/addons/website/static/src/css/website.sass
@@ -276,10 +276,15 @@ footer
background-color: grey
.parallax_full
- background: #eee bottom center repeat fixed
- min-height: 650px
+ background: #eee no-repeat top center
width: 100%
background-size: 100%
+ &.oe_small .container
+ height: 200px
+ &.oe_medium .container
+ height: 300px
+ &.oe_big .container
+ height: 450px
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal
diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js
index 35568e8336e..2732c397619 100644
--- a/addons/website/static/src/js/website.snippets.js
+++ b/addons/website/static/src/js/website.snippets.js
@@ -1198,7 +1198,36 @@
start : function () {
this._super();
this.change_background(this.$target, 'ul[name="parallax-background"]');
+ this.change_size();
},
+ change_size: function () {
+ var self = this;
+ var $el = this.$target;
+
+ var size = 'oe_big';
+ if (this.$target.hasClass('oe_small'))
+ size = 'oe_small';
+ else if (this.$target.hasClass('oe_medium'))
+ size = 'oe_medium';
+
+ var $ul = this.$editor.find('ul[name="parallax-size"]');
+ var $li = $ul.find("li");
+
+ $ul.find('[data-value="' + size + '"]').addClass('active');
+
+ $li.on('click', function (event) {
+ $li.removeClass("active");
+ $(this).addClass("active");
+ })
+ .on('mouseover', function (event) {
+ $el.removeClass('oe_big oe_small oe_medium');
+ $el.addClass($(event.currentTarget).data("value"));
+ })
+ .on('mouseout', function (event) {
+ $el.removeClass('oe_big oe_small oe_medium');
+ $el.addClass($ul.find('li.active').data("value"));
+ });
+ }
});
/*
diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml
index a351e07d4fd..6651e899762 100644
--- a/addons/website/views/snippets.xml
+++ b/addons/website/views/snippets.xml
@@ -677,6 +677,22 @@
Parallax
+
I{TRuVZXgF5@w2v8 MlAo1%)$!#xOo}KXgTuD;n$Xeo!6YJ**be=tV8wG@EGPXyj=8Hq6>w`
zu);#LojuQO^cndk}QdX`tGVx4JY$Bjz
zF49e~o8qE9sIpW?VKqg9etT}WF@177BeCCRt~6Q;h*G-3{ANWUicjFB0I)masGMhN
zSf8ozIF(lNSa-w>${yIC3d>XO8y`cr9v|O2
MG0~vHgLHc^
zp!k42eXy14ov)S`FfLS9iTuOE1?PkW*_o
&$zORl%uM|g<7;NgiQeuhN26pDnGk