Save
This commit is contained in:
@@ -31,6 +31,14 @@ $(function () {
|
|||||||
activateProductColors(boxHref)
|
activateProductColors(boxHref)
|
||||||
activateProductDrafts(boxHref)
|
activateProductDrafts(boxHref)
|
||||||
activateProductBanner(boxHref)
|
activateProductBanner(boxHref)
|
||||||
|
|
||||||
|
if ($(this).attr('colors')) {
|
||||||
|
$('#product-colors-preview-box').show();
|
||||||
|
let colorsArr = $(this).attr('colors').split(' ');
|
||||||
|
activateProductColorsTabs(colorsArr);
|
||||||
|
} else {
|
||||||
|
$('#product-colors-preview-box').hide();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function activateProductBox(boxHref) {
|
function activateProductBox(boxHref) {
|
||||||
@@ -74,11 +82,29 @@ $(function () {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
function activateProductColorsTabs(colors) {
|
||||||
|
console.log(colors);
|
||||||
|
|
||||||
|
if (colors && typeof colors === 'object') {
|
||||||
|
$('#nav_tabs_colors li').each(function() {
|
||||||
|
var href = $(this).find('a').attr('href').substring(1);
|
||||||
|
if (!colors.includes(href)) {
|
||||||
|
$(this).hide();
|
||||||
|
} else {
|
||||||
|
$(this).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let firstVisible = $('#nav_tabs_colors li:visible').first();
|
||||||
|
if (firstVisible.length > 0) {
|
||||||
|
firstVisible.find('a').trigger('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
$(function() {
|
|
||||||
var productColorsList = $("#product-colors-preview-box .scontainer-content")
|
var productColorsList = $("#product-colors-preview-box .scontainer-content")
|
||||||
|
|
||||||
$("#nav_tabs_colors li a").on("click", function (e) {
|
$("#nav_tabs_colors li a").on("click", function (e) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<div class="box-1">
|
<div class="box-1">
|
||||||
<div class="c-row">
|
<div class="c-row">
|
||||||
<img alt="" src="/upload/filemanager/pages/Promozione-invernale/PZ-podstrona-IT.jpg" />
|
<img alt="" src="/upload/filemanager/pages/Promozione-invernale/PZ-podstrona-IT-NEW.png" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user