3 let button = $('.js-menu');
4 let menu = $('.l-navigation__menu');
5 let menuLinks = menu.find('a');
7 button.on('click', function() {
8 if(!$(this).hasClass('is-active')) {
9 $(this).addClass('is-active');
10 menu.addClass('is-open');
11 button.find('.bar').addClass('animate');
12 menuLinks.attr('tabindex', 0);
14 $(this).removeClass('is-active');
15 menu.removeClass('is-open');
16 button.find('.bar').removeClass('animate');
17 menuLinks.attr('tabindex', -1);
21 $(document).keyup(function(e) {
22 if (e.keyCode === 27) {
23 button.removeClass('is-active');
24 menu.removeClass('is-open');
25 button.find('.bar').removeClass('animate');
26 menuLinks.attr('tabindex', -1);
31 // Ebook/Audiobook Btns
33 let button = $('.c-media__btn button:not(.l-button--media--full)');
34 let popupLayer = $('.c-media__popup');
35 let closeButton = $('.c-media__popup__close');
36 let playButton = $('.c-player__btn--md');
37 let chaptersButton = $('.c-player__chapters span');
38 let select = $('.c-select');
39 let selectItem = $('.c-select li');
40 let volumeButton = $('.icon-volume');
42 button.on('click', function () {
43 let target = $(this).attr('id');
44 $('[data-popup=' + target).addClass('is-open');
45 $('body').addClass('popup-open');
48 closeButton.on('click', function() {
49 $(this).closest('.c-media__popup').removeClass('is-open');
50 $('body').removeClass('popup-open');
53 popupLayer.on('click', function(e) {
55 if($(e.target).is(popupLayer)) {
56 _this.removeClass('is-open');
57 $('body').removeClass('popup-open');
61 chaptersButton.on('click', function() {
62 $(this).parent().toggleClass('is-active');
65 select.on('click', function() {
66 $(this).toggleClass('is-active');
69 selectItem.on('click', function() {
70 selectItem.removeClass('is-active');
71 $(this).addClass('is-active');
74 $(document).keyup(function(e) {
75 if (e.keyCode === 27) {
76 $('.c-media__popup').removeClass('is-open');
84 let slider = $('.l-author__quotes__slider');
97 // Text overlay toggler
99 let overlays = $('.l-article__overlay');
100 let button = $('.l-article__read-more');
102 overlays.each(function () {
103 let maxHeight = $(this).attr('data-max-height');
104 if($(this).outerHeight() > maxHeight) {
105 $(this).css({'maxHeight': maxHeight+'px'}).addClass('is-active');
107 $(this).next('.l-article__read-more').hide();
111 button.on('click', function() {
112 let dataLabel = $(this).attr('data-label');
113 let dataAction = $(this).attr('data-action');
114 $(this).parent().find('.l-article__overlay').toggleClass('is-clicked');
115 if($(this).text() === dataLabel) {
116 $(this).text(dataAction);
118 $(this).text(dataLabel);
123 //Zmieniamy siÄ™ popup
125 let $change = $('.l-change-pop');
127 if(localStorage.getItem('change') === null) {
128 $change.addClass('show');
134 $change.on('click', '.l-change-pop__close', function () {
136 localStorage.setItem('change', 'showed');
140 if($change.length) { change(); }
145 let $switchOnce = $('#switch-once');
146 let $switchMonthly = $('#switch-monthly');
148 $switchMonthly.on('click', function() {
149 $('.l-checkout__payments__box').removeClass('once');
152 $switchOnce.on('click', function() {
153 $('.l-checkout__payments__box').addClass('once');
159 let $copy = $('.js-copy');
161 $copy.on('click', function() {
162 let $copyText = $(this).closest('.l-checkout__info__item').find('input');
164 document.execCommand('copy');