Skip to content

Commit e458455

Browse files
authored
Merge pull request #357 from athemes/fix/customizer-tabs
Fix customizer tabs not working because of a change in the HTML structure
2 parents da512d5 + 94dafe3 commit e458455

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

assets/js/src/customizer-scripts.js

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -439,35 +439,28 @@ jQuery(document).ready(function ($) {
439439
$tab.addClass('active');
440440
$siblings.removeClass('active');
441441

442-
$.each(visibles, function (i, v) {
442+
visibles.forEach((element,i) => {
443443
if( i === 0 ) {
444-
$(this).addClass('botiga-tab-control-item-first');
444+
$(element).addClass('botiga-tab-control-item-first');
445445
}
446-
447446
if( i === visibles.length - 1 ) {
448-
$(this).addClass('botiga-tab-control-item-last');
447+
$(element).addClass('botiga-tab-control-item-last');
449448
}
450-
451-
$(this).removeClass('botiga-hide-control');
452-
});
449+
$(element).removeClass('botiga-hide-control');
450+
})
453451

454452
$siblings.each(function () {
455-
456-
var $sibling = $(this);
457-
var hiddens = $sibling.data('connected');
458-
459-
$.each(hiddens, function (i, v) {
453+
let $sibling = $(this);
454+
let hiddens = $sibling.data('connected');
455+
hiddens.forEach((element,i) => {
460456
if( i === 0 ) {
461-
$(this).removeClass('botiga-tab-control-item-first');
457+
$(element).addClass('botiga-tab-control-item-first');
462458
}
463-
464459
if( i === hiddens.length - 1 ) {
465-
$(this).removeClass('botiga-tab-control-item-last');
460+
$(element).addClass('botiga-tab-control-item-last');
466461
}
467-
468-
$(this).addClass('botiga-hide-control');
469-
});
470-
462+
$(element).addClass('botiga-hide-control');
463+
})
471464
});
472465

473466
});

0 commit comments

Comments
 (0)