X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4dad587dac33c6c04d9a1a594fbbd1c58dbf2bda..fd1a9915dd65789cccf27041a1f01cd4077273fc:/src/wolnelektury/static/2021/scripts/main.js?ds=inline diff --git a/src/wolnelektury/static/2021/scripts/main.js b/src/wolnelektury/static/2021/scripts/main.js index 4d177715c..1ffea17c8 100644 --- a/src/wolnelektury/static/2021/scripts/main.js +++ b/src/wolnelektury/static/2021/scripts/main.js @@ -1,7 +1,7 @@ // JS Menu (function () { let button = $('.js-menu'); - let menu = $('.l-navigation__menu'); + let menu = $('.l-navigation'); let menuLinks = menu.find('a'); button.on('click', function() { @@ -148,20 +148,19 @@ })(); -//Switch (function() { - let $switchOnce = $('#switch-once'); - let $switchMonthly = $('#switch-monthly'); - - $switchMonthly.on('click', function() { - $('.l-checkout__payments__box').removeClass('once'); - }); - - $switchOnce.on('click', function() { - $('.l-checkout__payments__box').addClass('once'); - }); + $('.l-checkout__payments__box button').on('click', function() { + let container = $(this).closest('.l-checkout__payments'); + $('input', container).val($(this).val()); + $('.is-active', container).removeClass('is-active'); + $(this).closest('.l-checkout__payments__box').addClass('is-active'); + $('#kwota').val(''); + return false; + }); + })(); + //Copy function (function() { let $copy = $('.js-copy');