$(document).ready(function() { $("#reinnoire_abonament").on("click", function() { console.log("Clicked reinnoire_abonament"); }) // Show only the first group of products (corresponding to the first account) $('.productList').hide(); $('.productList').first().show(); // Select the first available product of the first group (subsequently calls loadNboOffers() ) $(".options_box.notitle .option_single input").first().click(); }); function loadNboOffers(input){ var siidVal = $(input).attr("data-siid"); var accountCodeVal = $(input).attr("data-account-code"); var currentProductVal = $(input).attr("data-current-product"); var currentMonthlyPriceVal = $(input).attr("data-current-monthly-price"); var addressVal = $(input).attr("data-address"); $.post("/blocks/category/plan/nboOfferListingAjax.jsp", {siid: siidVal, accountCode: accountCodeVal, currentProduct: currentProductVal, address: addressVal, currentMonthlyPrice: currentMonthlyPriceVal }, function(data, status){ // if the call returned successfully and the user is available for renewal if(status == "success" && data.isAvailableForRenewal){ $('#notAvailableForNbo').hide(); $('#promoBoxes').hide(); $('#nboOffersListingPlaceHolder').html(data.nboOffers); $('.confirmModal').remove(); $('#modalsPlaceholder').after(data.nboModals); } // else display that the user is not available for renewal else { $('.confirmModal').remove(); $('#nboOffersListingPlaceHolder').hide(); $('#notAvailableForNbo').show(); $('#promoBoxes').show(); } }, 'json'); }; function closeConfirmModal() { $('.confirmModal').removeClass('is-visible'); $('#modalOverlay').removeClass('is-visible'); } function openModal(selectedConfirmModalId) { $('#' + selectedConfirmModalId).toggleClass('is-visible'); $('#modalOverlay').toggleClass('is-visible'); } (function ($) { $('.facet-checkbox').on('click', function () { var selected = !!$(this).prop('checked'); if (selected) { $(this).parents('label.checkbox').addClass('checked'); } else { $(this).parents('label.checkbox').removeClass('checked'); } }); var colHeight = 0; var listheight = 0; if($(window).width() > 720) { $(".block .col").each(function( key, col ){ if( $(col).height() > colHeight){ colHeight = $(col).height(); } }).each(function( key, col ){ $(col).height(colHeight); }); $(".block .block-list").each(function( key, col ){ if( $(col).height() > listheight){ listheight = $(col).height(); } }).each(function( key, col ){ $(col).height(listheight); }); } function changeListToPortrait( reverse ){ if( reverse ){ $('.tvListDisplay').addClass('listDisplay'); } else { $('.tvListDisplay').removeClass('listDisplay'); } $('.tvListDisplay .tvItem').each(function (key, item) { var jItem = $(item), title = jItem.find('h3'), price = jItem.find('.thirdCol'), img = jItem.find('.imgWrap'); if (reverse) { jItem.addClass('landscape'); title.insertBefore(img); title.addClass('col-md-12'); price.addClass('col-md-4'); } else { jItem.removeClass('landscape'); img.insertBefore(title); title.removeClass('col-md-12'); price.removeClass('col-md-4'); } }); } function checkedInputs(item, onclick) { var checked = $(item).prop('checked'); if (checked) { if (onclick) { $(item).prop('checkbox', false).parents('label.checkbox').removeClass('checked'); } else { $(item).prop('checkbox', true).parents('label.checkbox').addClass('checked'); } } else { if (onclick) { $(item).prop('checkbox', true).parents('label.checkbox').addClass('checked'); } else { $(item).prop('checkbox', false).parents('label.checkbox').removeClass('checked'); } } } $(window).on('DOMContentLoaded resize', function () { if ($(this).width() <= 768) { changeListToPortrait(); } else { changeListToPortrait(true); } // make checked the labels $('.facet-checkbox').on('click', function () { checkedInputs(this); }).each(function (key, item) { checkedInputs(item); }); }); function switchListGrid(reverse) { if (reverse) { $('.tvWrapper').addClass('listDisplay'); } else { $('.tvWrapper').removeClass('listDisplay'); } $('.tvItem').each(function (key, item) { var jItem = $(item), title = jItem.find('h3'), features = jItem.find('ul.features'), price = jItem.find('.thirdCol'), img = jItem.find('.imgWrap'), subscription = jItem.find('.subscriptionInfo'); if (reverse) { img.addClass('col-md-4'); jItem.removeClass('col-md-4').addClass('col-md-12').addClass('landscape'); title.insertBefore(img); features.addClass('col-md-4'); title.addClass('col-md-12'); price.addClass('col-md-4'); subscription.addClass('col-md-12'); } else { jItem.removeClass('col-md-12').addClass('col-md-4').removeClass('landscape'); img.removeClass('col-md-4').insertBefore(title); features.removeClass('col-md-4'); title.removeClass('col-md-12'); price.removeClass('col-md-4'); subscription.removeClass('col-md-12'); } }); } $('.listing-sorter .list-grid').on('click', function () { $('.listing-sorter .list-list').removeClass('list-list-active'); $(this).addClass('list-grid-active'); switchListGrid(); }); $('.listing-sorter .list-list').on('click', function () { $('.listing-sorter .list-grid').removeClass('list-grid-active'); $(this).addClass('list-list-active'); switchListGrid(true); }); if ($('#demo').length) { var productItems = window.swiperAvantages({target: "#demo"}, 430); } // owlTabs({ target: 'ul.nav-tabs', width: 425}); })(jQuery); $('.popupcontent').on('scroll', function (e) { var top = $('.popupcontent').scrollTop(); $('.close').css('top', top); }); jQuery(document).ready(function ($) { $('.openpopup').click(function (e) { e.preventDefault(); var href = $(this).attr('href'); $('html').css('overflow', 'hidden'); $(href).fadeIn(); }); $('.close').click(function (e) { e.preventDefault(); $(this).parent().fadeOut(); $('html').css('overflow', 'auto'); }); }); $(document).ready(function () { window.columnDone = false; $(window).on('load', function () { if ($(window).width() < 767) { if( window.columnDone === false){ var pachete = new Swiper('.swiper-container', { pagination: '.swiper-pagination', slidesPerView: 5, spaceBetween: 40, breakpoints: { 768: { spaceBetween: 0, centeredSlides: true, slidesPerView: 'auto' } } }); $(window).trigger('resizeEnd'); $(".pachete-box .swiper-wrapper").each(function( key, parent ){ var children = $(parent).children(), lastChild = children.last(); lastChild.insertAfter( $(parent).parents('.swiper-container')); }); $(".pachete-box .swiper-wrapper").each(function( key, parent ){ var children = $(parent).children(), height = $(parent).height(); children.each(function( key, item){ $(item).height( height); }); }); window.columnDone = true; } } else { $(".pachete-box .swiper-wrapper").each(function( key, parent ){ var children = $(parent).children(), height = $(parent).height(); children.each(function( key, item){ $(item).height( height); }); }); } }); }); $(window).bind('resizeEnd', function(){ // bullets var wrapper = $('.swiper-wrapper'), pagination = $('.swiper-pagination'), classes = ['blue','lime','orange', 'green'], selectedClass; $.each(wrapper,function(index, parent){ $.each($(parent).children(), function( index, child){ selectedClass = ''; $.each(classes, function(key, item){ if( $(child).hasClass(item)){ selectedClass = item; } }); $($(parent).parents('.swiper-container').find('.swiper-pagination').children()[index]).addClass(selectedClass); }); }); }); $(window).resize(function(){ if(this.resizeTO) clearTimeout(this.resizeTO); this.resizeTO = setTimeout(function() { $(this).trigger('resizeEnd'); }, 1); }); // Close Success Alert $('.telekomAlertBox .closeBtn').bind('click', function(){ $(this).parent().remove(); });