1+function ($) { 2 "use strict"; 3 4 var StaffSlider = function (element, options) { 5 var self = this; 6 self.$element = $(element); 7 self.options = options; 8 9 var callbacks = { 10 start: function (slider) { 11 self.fixVerticalSlideSmoothHeight(slider); 12 $(window).resize(function () { self.fixVerticalSlideSmoothHeight(slider); }); 13 }, 14 before: function () { 15 }, 16 after: function (slider) { 17 self.fixVerticalSlideSmoothHeight(slider); 18 } 19 }; 20 21 $.extend(self.options, callbacks); 22 23 self.attachEvents(); 24 self.initializeSlider(); 25 function triggerScroll() { setTimeout(function () { $(window).trigger("scroll"); }, 600); } 26 27 return self; 28 } 29 30 StaffSlider.prototype.attachEvents = function () { 31 var self = this; 32 if (self.options.direction === 'vertical') $(window).resize(function () { self.fixVerticalSlideHeight();}); 33 } 34 35 StaffSlider.prototype.initializeSlider = function () { 36 var self = this; 37 self.$bxSlider = self.$element.flexslider(self.options); 38 if (self.options.direction === 'vertical') self.fixVerticalSlideHeight(); 39 } 40 41 StaffSlider.prototype.fixVerticalSlideHeight = function () { 42 var self = this, 43 maxHeight = 0, 44 slides = self.$element.find('.slides'); 45 46 slides.children().height('auto').each(function () { 47 maxHeight = Math.max(maxHeight, $(this).height()); 48 }).height(maxHeight); 49 50 slides.height(maxHeight); 51 } 52 53 StaffSlider.prototype.fixVerticalSlideSmoothHeight = function (slider) { 54 var self = this; 55 if (self.options.direction === 'vertical' && self.options.smoothHeight == 1) { 56 var activeSlideHeight = $(slider).find('.flex-active-slide > div').height(); 57 $(slider).find('.flex-viewport').height(activeSlideHeight); 58 } 59 } 60 61 StaffSlider.DEFAULTS = { 62 adaptiveHeight: true, 63 easing: null, 64 useCSS: false 65 } 66 67 var old = $.fn.StaffSlider; 68 69 $.fn.StaffSlider = function (option) { 70 var args = arguments, result, obj; 71 72 var $this = $(this); 73 StaffSlider.DEFAULTS.controlsContainer = $('.flex-control-nav', $(this).parent()); 74 StaffSlider.DEFAULTS.customDirectionNav = $('.controls-wrapper a', $(this).parent()); 75 var options = $.extend({}, StaffSlider.DEFAULTS, $this.data(), typeof option == 'object' && option); 76 var data = ''; 77 78 return new StaffSlider(this, options); 79 }; 80 81 $.fn.StaffSlider.Constructor = StaffSlider 82 83 $.fn.StaffSlider.noConflict = function () { 84 $.fn.StaffSlider = old 85 } 86 87 $(window).load(function () { 88 var $staffSection = $(".js-staff-layout-settings .flexslider"); 89 if ($staffSection.length) { 90 $staffSection.each(function () { 91 $(this).StaffSlider(); 92 }); 93 } 94 }); 95 96}(window.jQuery);
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.