1"use strict"; 2 3window.console = window.console || { 4 log: function () { 5 }, debug: function () { 6 } 7}; 8 9var dtbakerPageSlider = { 10 init: function ($) { 11 if ($().slick) { 12 13 var $carousel = $('.elementor-page-carousel'); 14 if ($carousel.length) { 15 16 $carousel.each(function () { 17 var savedOptions = $(this).data('slider_options'), 18 tabletSlides = 1 === savedOptions.slidesToShow ? 1 : 2, 19 defaultOptions = { 20 responsive: [ 21 { 22 breakpoint: 767, 23 settings: { 24 slidesToShow: tabletSlides, 25 slidesToScroll: tabletSlides 26 } 27 }, 28 { 29 breakpoint: 480, 30 settings: { 31 slidesToShow: 1, 32 slidesToScroll: 1 33 } 34 } 35 ] 36 }, 37 slickOptions = $.extend({}, defaultOptions, savedOptions); 38 $(this).slick(slickOptions); 39 if (typeof savedOptions.dtbaker_type !== 'undefined' && 'icons' === savedOptions.dtbaker_type) { 40 $('.elementor-page-carousel-icons [data-slide-id]').first().addClass('current'); 41 var $thisslick = $(this); 42 var current_slide = 0; 43 (function () { 44 var $clickslick = $thisslick; 45 $('.elementor-page-carousel-icons [data-slide-id]').click(function () { 46 //var current_slide = parseInt($clickslick.slick('slickCurrentSlide')); 47 var next_slide = parseInt($(this).index()); 48 if (current_slide === next_slide) { 49 // user has clicked twice on the icon button 50 // redirect 51 var url = $(this).data('link'); 52 if (url && '#' !== url) { 53 window.location.href = url; 54 return; 55 } 56 } 57 $clickslick.slick('slickGoTo', next_slide); 58 }); 59 }()); 60 $(this).on('beforeChange', function (events, slick, currentSlide, nextSlide) { 61 // grab the next html id of the slide. 62 var next_id = $(slick['$slides'][nextSlide]).data('slide-id'); 63 $('.elementor-page-carousel-icons .current').removeClass('current'); 64 $('.elementor-page-carousel-icons [data-slide-id="' + next_id + '"]').addClass('current'); 65 }); 66 $(this).on('afterChange', function (events, slick, currentSlide, nextSlide) { 67 current_slide = currentSlide; 68 }); 69 } 70 71 }); 72 } 73 } 74 } 75 76}; 77 78jQuery(function ($) { 79 dtbakerPageSlider.init($); 80});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.