+ $('body').removeClass('popup-open');
+ });
+
+ popupLayer.on('click', function(e) {
+ let _this = $(this);
+ if($(e.target).is(popupLayer)) {
+ _this.removeClass('is-open');
+ $('body').removeClass('popup-open');
+ }
+ });
+
+ chaptersButton.on('click', function() {
+ $(this).parent().toggleClass('is-active');
+ });
+
+ select.on('click', function() {
+ $(this).toggleClass('is-active');
+ });
+
+ selectItem.on('click', function() {
+ selectItem.removeClass('is-active');
+ $(this).addClass('is-active');
+ });
+
+ volumeButton.on('click', function() {
+ if($(this).hasClass('icon-volume')) {
+ $(this).removeClass('icon-volume').addClass('icon-mute');
+ $(this).next().val(0);
+ $(this).next().css('background-size', '0% 100%');
+ } else if($(this).hasClass('icon-mute')) {
+ $(this).removeClass('icon-mute').addClass('icon-volume');
+ $(this).next().val(50);
+ $(this).next().css('background-size', '50% 100%');
+ }