|
|
@ -1,15 +1,19 @@ |
|
|
|
import $ from 'jquery' |
|
|
|
import $ from 'jquery' |
|
|
|
|
|
|
|
|
|
|
|
$(function () { |
|
|
|
$(function () { |
|
|
|
const activeTabCard = $('.card-tab.active') |
|
|
|
const tabCards = $('.js-card-tabs') |
|
|
|
|
|
|
|
const activeTabCard = tabCards.find('.active') |
|
|
|
|
|
|
|
const isMobileCardTabs = tabCards.children(':hidden').length |
|
|
|
|
|
|
|
const isOnlyChild = !activeTabCard.siblings().length |
|
|
|
|
|
|
|
|
|
|
|
if (!activeTabCard.siblings().length) { |
|
|
|
if (isOnlyChild) { |
|
|
|
activeTabCard.addClass('noCaret') |
|
|
|
activeTabCard.addClass('noCaret') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
activeTabCard.on('click', function (e) { |
|
|
|
activeTabCard.on('click', function (e) { |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isMobileCardTabs) { |
|
|
|
const siblings = $(this).siblings() |
|
|
|
const siblings = $(this).siblings() |
|
|
|
|
|
|
|
|
|
|
|
if (siblings.is(':hidden')) { |
|
|
|
if (siblings.is(':hidden')) { |
|
|
@ -17,5 +21,6 @@ $(function () { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
siblings.hide() |
|
|
|
siblings.hide() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|