Permalink
Browse files

Change the resizer, ok to the height

  • Loading branch information...
qha-odoo committed Nov 7, 2018
1 parent a3ba4e7 commit 53416834b2cc0674bce739a3ffb5271f1199170b
@@ -216,7 +216,7 @@ sAnimations.registry.WebsiteSale = sAnimations.Class.extend(ProductConfiguratorM
}
// Size of the columns // Numbers of collumns
var $normalWidth = 31;
// var $normalWidth = 31;
// test loop for to remove 'o_btn_col_4---3---2' and be dynamic
// for(var $num = 2; $num <= 4; $num ++){
// console.log('ok primal')
@@ -247,115 +247,114 @@ sAnimations.registry.WebsiteSale = sAnimations.Class.extend(ProductConfiguratorM
// $(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
// });
// }
if($('.oe_list').hasClass('o_grid_products_list')){
$('.o_apply_list').addClass('o_semi_opacity');
$('.o_apply_grid').removeClass('o_semi_opacity');
$('.o_choose_column').show();
$('.o_very_big').hide();
}
// if($('.oe_list').hasClass('o_grid_products_list')){
// $('.o_apply_list').addClass('o_semi_opacity');
// $('.o_apply_grid').removeClass('o_semi_opacity');
// $('.o_choose_column').show();
// $('.o_very_big').hide();
// }
// find the biggest div to apply a *2 after
var $productList = $('.o_grid_products_list');
var $productSize = [];
// var $productList = $('.o_grid_products_list');
// var $productSize = [];
$productList.each(function(products) {
$productSize.push($(this).height());
// console.log($productSize);
});
console.log($productSize);
var $biggestProductHeight = Math.max(...$productSize);
console.log($biggestProductHeight);
// $productList.each(function(products) {
// $productSize.push($(this).height());
// });
// console.log($productSize);
// var $biggestProductHeight = Math.max(...$productSize);
// console.log($biggestProductHeight);
$productList.css('height', $biggestProductHeight + 'px');
// $productList.css('height', $biggestProductHeight + 'px');
// Liste view
$('.o_apply_list').click(function(){
var $parentContainer = $(this).parents('.container');
// $('.o_apply_list').click(function(){
// var $parentContainer = $(this).parents('.container');
$(this).parent().children('.o_apply_grid').addClass('o_semi_opacity');
$(this).removeClass('o_semi_opacity');
$parentContainer.find('.oe_list').removeClass('o_grid_products_list');
$parentContainer.find('.oe_list').css('height', 'auto');
$parentContainer.find('.o_choose_column').hide();
$parentContainer.find('.oe_list').css('max-width', '100%');
});
// $(this).parent().children('.o_apply_grid').addClass('o_semi_opacity');
// $(this).removeClass('o_semi_opacity');
// $parentContainer.find('.oe_list').removeClass('o_grid_products_list');
// // $parentContainer.find('.oe_list').css('height', 'auto');
// $parentContainer.find('.o_choose_column').hide();
// $parentContainer.find('.oe_list').css('max-width', '100%');
// });
// grid view
$('.o_apply_grid').click(function(){
var $parentContainer = $(this).parents('.container');
// $('.o_apply_grid').click(function(){
// var $parentContainer = $(this).parents('.container');
$(this).parent().children('.o_apply_list').addClass('o_semi_opacity');
$(this).removeClass('o_semi_opacity');
$parentContainer.find('.oe_list').addClass('o_grid_products_list');
$parentContainer.find('.o_choose_column').show();
$parentContainer.find('.oe_list').css('max-width', '31%');
$parentContainer.find('.o_choose_column span').removeClass('active');
$parentContainer.find('.o_choose_column .o_btn_col_3').addClass('active');
$parentContainer.find('.o_big').show();
$parentContainer.find('.o_very_big').hide();
});
// $(this).parent().children('.o_apply_list').addClass('o_semi_opacity');
// $(this).removeClass('o_semi_opacity');
// $parentContainer.find('.oe_list').addClass('o_grid_products_list');
// $parentContainer.find('.o_choose_column').show();
// $parentContainer.find('.oe_list').css('max-width', '31%');
// $parentContainer.find('.o_choose_column span').removeClass('active');
// $parentContainer.find('.o_choose_column .o_btn_col_3').addClass('active');
// $parentContainer.find('.o_big').show();
// $parentContainer.find('.o_very_big').hide();
// });
// general change in 2_3_4 columns on the select
$('.o_btn_col_2').click(function(){
$(this).parents('.o_choose_column').find('span').removeClass('active');
$(this).addClass('active');
$normalWidth = 48;
$(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
$(this).parents('.container').find('.oe_list').css('width', $normalWidth + '%');
$(this).parents('.container').find('.o_big').hide();
$(this).parents('.container').find('.o_very_big').hide();
});
$('.o_btn_col_3').click(function(){
$(this).parents('.o_choose_column').find('span').removeClass('active');
$(this).addClass('active');
$normalWidth = 31;
$(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
$(this).parents('.container').find('.oe_list').css('width', $normalWidth + '%');
$(this).parents('.container').find('.o_big').show();
$(this).parents('.container').find('.o_very_big').hide();
});
$('.o_btn_col_4').click(function(){
$(this).parents('.o_choose_column').find('span').removeClass('active');
$(this).addClass('active');
$normalWidth = 23;
$(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
$(this).parents('.container').find('.oe_list').css('width', $normalWidth + '%');
$(this).parents('.container').find('.o_big').show();
$(this).parents('.container').find('.o_very_big').show();
});
// $('.o_btn_col_2').click(function(){
// $(this).parents('.o_choose_column').find('span').removeClass('active');
// $(this).addClass('active');
// $normalWidth = 48;
// $(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
// $(this).parents('.container').find('.oe_list').css('width', $normalWidth + '%');
// $(this).parents('.container').find('.o_big').hide();
// $(this).parents('.container').find('.o_very_big').hide();
// });
// $('.o_btn_col_3').click(function(){
// $(this).parents('.o_choose_column').find('span').removeClass('active');
// $(this).addClass('active');
// $normalWidth = 31;
// $(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
// $(this).parents('.container').find('.oe_list').css('width', $normalWidth + '%');
// $(this).parents('.container').find('.o_big').show();
// $(this).parents('.container').find('.o_very_big').hide();
// });
// $('.o_btn_col_4').click(function(){
// $(this).parents('.o_choose_column').find('span').removeClass('active');
// $(this).addClass('active');
// $normalWidth = 23;
// $(this).parents('.container').find('.oe_list').css('max-width', $normalWidth + '%');
// $(this).parents('.container').find('.oe_list').css('width', $normalWidth + '%');
// $(this).parents('.container').find('.o_big').show();
// $(this).parents('.container').find('.o_very_big').show();
// });
// choose the number of columns of this div
$('.o_little').click(function() {
var $scaleSizeCalcutate = $normalWidth;
$(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
$(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
});
$('.o_medium').click(function() {
var $scaleSizeCalcutate = $normalWidth * 2 + 2;
$(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
$(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
});
$('.o_big').click(function() {
var $scaleSizeCalcutate = $normalWidth * 3 + 4;
$(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
$(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
});
$('.o_very_big').click(function() {
var $scaleSizeCalcutate = $normalWidth * 4 + 6;
$(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
$(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
});
// $('.o_little').click(function() {
// var $scaleSizeCalcutate = $normalWidth;
// $(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
// $(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
// });
// $('.o_medium').click(function() {
// var $scaleSizeCalcutate = $normalWidth * 2 + 2;
// $(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
// $(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
// });
// $('.o_big').click(function() {
// var $scaleSizeCalcutate = $normalWidth * 3 + 4;
// $(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
// $(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
// });
// $('.o_very_big').click(function() {
// var $scaleSizeCalcutate = $normalWidth * 4 + 6;
// $(this).parents('.oe_list').css('max-width', $scaleSizeCalcutate + '%');
// $(this).parents('.oe_list').css('width', $scaleSizeCalcutate + '%');
// });
// choose the number of lines of this div
$('.o_little_line').click(function() {
var $heightCalculate = $biggestProductHeight;
$(this).parents('.oe_list').css('height', $heightCalculate + 'px');
$(this).parents('.oe_list').find('.o_product_image').css('height', '170px');
});
$('.o_big_line').click(function() {
var $heightCalculate = $biggestProductHeight * 2 + 16;
var $imgHeightCalculate = $biggestProductHeight +($biggestProductHeight / 2);
$(this).parents('.oe_list').css('height', $heightCalculate + 'px');
$(this).parents('.oe_list').find('.o_product_image').css('height', $imgHeightCalculate + 'px');
});
// $('.o_little_line').click(function() {
// var $heightCalculate = $biggestProductHeight;
// $(this).parents('.oe_list').css('height', $heightCalculate + 'px');
// $(this).parents('.oe_list').find('.o_product_image').css('height', '170px');
// });
// $('.o_big_line').click(function() {
// var $heightCalculate = $biggestProductHeight * 2 + 16;
// var $imgHeightCalculate = $biggestProductHeight +($biggestProductHeight / 2);
// $(this).parents('.oe_list').css('height', $heightCalculate + 'px');
// $(this).parents('.oe_list').find('.o_product_image').css('height', $imgHeightCalculate + 'px');
// });
return def;
},
@@ -1,8 +1,8 @@
/* ---- Default Styles ---- */
.oe_product {
/*.oe_product {
border: 1px solid rgba(100,100,100,0.2);
}
}*/
.oe_website_sale {
/*ul ul {
@@ -279,19 +279,43 @@
}
.oe-height-2 {
height: 250px;
height: 400px;
/*.o_product_image{
height: 170px;
}
.o_info_product_container{
height: 210px;
}*/
}
.oe-height-4 {
height: 500px;
height: 800px;
.o_product_image{
height: 400px;
}
.o_info_product_container{
height: 400px;
}
}
.oe-height-6 {
height: 750px;
height: 1200px;
.o_product_image{
height: 600px;
}
.o_info_product_container{
height: 550px;
}
}
.oe-height-8 {
height: 1000px;
height: 1600px;
.o_product_image{
height: 1000px;
}
.o_info_product_container{
height: 550px;
}
}
}
@@ -755,25 +779,20 @@ a.no-decoration {
}
}
.o_grid_products_list.oe_list{
width: 31%;
max-width: 31%;
/*width: 31%;
max-width: 31%;*/
float:left;
margin: 0 1% 20px;
/*margin: 0 1% 20px;*/
border-bottom: 0 !important;
position: relative;
border: 1px solid $gray-200 !important;
/*border: 1px solid $gray-200 !important;*/
border-radius: 5px;
transition: ease .4s;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, .02);
background-color: #fff;
padding: 0;
@include media-breakpoint-down(md){
width: 48%;
max-width: 48%;
}
@include media-breakpoint-down(sm){
width: 100%;
max-width: 100% !important;
/*background-color: #fff;*/
/*padding: 0;*/
.oe_product_cart{
box-shadow: 0 0 20px 0 rgba(0, 0, 0, .02);
transition: .4s ease;
}
form{
width: 100%;
@@ -786,21 +805,14 @@ a.no-decoration {
width: 100%;
margin: 0;
padding: 0 !important;
/*.oe_product_image{
width: 100%;
height: 200px;
max-width: 100%;
flex: none;
padding: 0;
transition: ease .4s;
}*/
.o_info_product_container{
width: 100%;
max-width: 100%;
flex: 100%;
display: block;
padding: 10px 10%;
text-align: center;
height: 215px;
}
.o_published_btn{
top: 0;
@@ -833,55 +845,16 @@ a.no-decoration {
padding-bottom: 10px;
border-bottom: 1px solid $gray-200;
}
/*&:hover{
box-shadow: 0 0 40px 0 rgba(0, 0, 0, .2);
transform: scale(1.1);
z-index: 9999;
}*/
/*&.o_col_2{
width: 48%;
max-width: 48%;
@include media-breakpoint-down(sm){
width: 100%;
max-width: 100% !important;
}
}
&.o_col_3{
width: 31%;
max-width: 31%;
@include media-breakpoint-down(md){
width: 48%;
max-width: 48% !important;
}
@include media-breakpoint-down(sm){
width: 100%;
max-width: 100% !important;
}
}
&.²4{
width: 23%;
max-width: 23%;
@include media-breakpoint-down(lg){
width: 31%;
max-width: 31% !important;
}
@include media-breakpoint-down(md){
width: 48%;
max-width: 48% !important;
}
@include media-breakpoint-down(sm){
width: 100%;
max-width: 100% !important;
}
}*/
}
.oe_list{
transition: ease .4s;
}
.oe_list:hover{
box-shadow: 0 0 40px 0 rgba(0, 0, 0, .2);
transform: scale(1.04);
z-index: 9;
.oe_product_cart{
box-shadow: 0 0 40px 0 rgba(0, 0, 0, .2);
}
}
.o_choose_column{
Oops, something went wrong.

0 comments on commit 5341683

Please sign in to comment.