1if (typeof Block2_3Slider === 'undefined') { 2 function Block2_3Slider(blockId) { 3 this.$slider = $('#block_' + blockId).find('.tizers'); 4 this.options = { 5 arrows: false, 6 dots: true, 7 cssEase: 'linear', 8 slidesToShow: 1, 9 }; 10 this.isInitProcess = false; 11 this.isDestroyProcess = false; 12 13 this.subscribeToEvents(); 14 this.resizeHandler(); 15 } 16 17 Block2_3Slider.prototype.dotsHandler = function (e, slick) { 18 slick.$slider.find('.slick-dots li').each(function () { 19 $(this).addClass('theme-bg'); 20 }); 21 if (slick.$slider.find('.slick-track').children().length === 1) { 22 slick.$slider.addClass('slider--one-slide'); 23 } 24 }; 25 Block2_3Slider.prototype.lazyLoadHandler = function (e, slick) { 26 if (typeof lazyLoadInstance !== 'undefined') { 27 lazyLoadInstance.update(); 28 } 29 }; 30 Block2_3Slider.prototype.isMobile = function () { 31 return window.matchMedia('(max-width: 767px)').matches; 32 }; 33 Block2_3Slider.prototype.isInit = function () { 34 return this.$slider.hasClass('slick-initialized'); 35 }; 36 Block2_3Slider.prototype.isProcess = function () { 37 return this.isInitProcess || this.isDestroyProcess; 38 }; 39 Block2_3Slider.prototype.resizeHandler = function () { 40 if (this.isProcess()) { 41 return; 42 } 43 if (this.isMobile() && !this.isInit()) { 44 this.isInitProcess = true; 45 this.$slider.slick(this.options); 46 return; 47 } 48 if (!this.isMobile() && this.isInit()) { 49 this.isDestroyProcess = true; 50 this.$slider.slick('unslick'); 51 } 52 }; 53 Block2_3Slider.prototype.initHandler = function (slick) { 54 this.isInitProcess = false; 55 }; 56 Block2_3Slider.prototype.destroyHandler = function (event, slick) { 57 this.isDestroyProcess = false; 58 }; 59 Block2_3Slider.prototype.subscribeToEvents = function () { 60 this.$slider.on('init reInit afterChange', this.lazyLoadHandler); 61 this.$slider.on('init reInit', this.dotsHandler.bind(this)); 62 this.$slider.on('init reInit', this.initHandler.bind(this)); 63 this.$slider.on('destroy', this.destroyHandler.bind(this)); 64 $(window).on('resize', this.resizeHandler.bind(this)); 65 }; 66 Block2_3Slider.prototype.release = function () { 67 this.$slider.off('init reInit afterChange', this.lazyLoadHandler); 68 this.$slider.off('init reInit', this.dotsHandler.bind(this)); 69 this.$slider.off('init reInit', this.initHandler.bind(this)); 70 this.$slider.off('destroy', this.destroyHandler.bind(this)); 71 $(window).off('resize', this.resizeHandler.bind(this)); 72 }; 73}
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.