1/* jshint esnext: true */ 2var document, 3 window; 4(function ($) { 5 'use stict'; 6 7 const flat = {}; 8 9 // preloader 10 flat.fnPreloader = () => { 11 flat.preloader = $('.preloader'); 12 if (flat.preloader.length) { 13 flat.preloader.fadeOut(1000); 14 } 15 }; 16 17 18 flat.customCode = () => { 19 // dynamic-margin-padding 20 var dataMargin = $('[data-margin]'); 21 dataMargin.each(function () { 22 var getMargin = $(this).attr('data-margin'); 23 $(this).css('margin', getMargin); 24 }); 25 var dataPadding = $('[data-padding]'); 26 dataPadding.each(function () { 27 var getPadding = $(this).attr('data-padding'); 28 $(this).css('padding', getPadding); 29 }); 30 31 flat.faq = $('.faq'); 32 flat.faq.each(function () { 33 flat.singleFaq = $(this).find('.single-item'); 34 flat.singleFaq.on('click', function () { 35 $(this).find('.content').slideToggle(); 36 $(this).toggleClass('active'); 37 }); 38 }); 39 40 flat.windowHeight = $(window).height(); 41 $('.window-height').css('min-height',flat.windowHeight); 42 43 flat.searchIcon = $('.search-icon'); 44 flat.searchForm = $('.search-form'); 45 flat.searchIcon.on('click', function() { 46 $(this).add(flat.searchForm).toggleClass('active'); 47 }); 48 }; 49 50 flat.fnPlugins = () => { 51 if($.fn.barfiller){ 52 flat.b_filler = $('.barfiller'); 53 flat.b_filler.barfiller(); 54 } 55 if($.fn.slicknav){ 56 $('#menu > ul').slicknav( 57 { 58 'parentTag':'a', 59 init:function () { 60 $('.slicknav_nav .has-child > a').each(function(){ 61 var $this = $(this); 62 $this.append('<span class="submenu_toggler "><i class="fa fa-angle-down"></i></span>'); 63 }); 64 $('.slicknav_nav .has-child > a').on('click',function(){ 65 $parentLi = $(this).parent(); 66 67 $('.dropdown-menu',$parentLi).slideToggle(); 68 if ($('.submenu_toggler',$parentLi ).hasClass('active-span')) { 69 $('.submenu_toggler i', $parentLi).removeClass('fa-angle-up').addClass('fa-angle-down'); 70 } else { 71 $('i',$parentLi).addClass('fa-angle-up').removeClass('fa-angle-down'); 72 } 73 $('.submenu_toggler' , $parentLi).toggleClass('active-span'); 74 }); 75 }, 76 } 77 ); 78 } 79 }; 80 81 flat.wlPlugins = () => { 82 if ($.fn.isotope) { 83 84 flat.portfolio_isotope = $('.portfolio-isotope'); 85 flat.portfolio_menu = $('.isotope-menu li'); 86 flat.portfolio_isotope.isotope({ 87 itemSelector: '.single-portfolio', 88 layoutMode: 'fitRows' 89 }); 90 91 flat.portfolio_menu.on('click', function () { 92 flat.portfolio_menu.removeClass("active"); 93 $(this).addClass("active"); 94 var selector = $(this).attr('data-filter'); 95 flat.portfolio_isotope.isotope({ 96 filter: selector, 97 animationOptions: { 98 duration: 750, 99 easing: 'linear', 100 queue: false, 101 } 102 }); 103 return false; 104 }); 105 106 } 107 108 if (typeof loopcounter !== 'undefined') { 109 loopcounter('counter-box'); // jshint ignore:line 110 } 111 }; 112 113 flat.fnSlider = () => { 114 if ($.fn.owlCarousel) { 115 flat.heroSlider = $('.hero-slider'); 116 flat.heroSlider.addClass('owl-carousel'); 117 flat.heroSlider.owlCarousel({ 118 items: 1, 119 autoplay: true, 120 animateIn: 'fadeIn', 121 animateOut: 'fadeOutLeft', 122 loop: true, 123 autoplayHoverPause: true, 124 nav: true, 125 autoHeight:true, 126 navText: [ 127 '<i class="fa fa-angle-left"></i>', 128 '<i class="fa fa-angle-right"></i>' 129 ] 130 }); 131 132 flat.tstSlider = $('.testimonial-slider'); 133 flat.tstSlider.addClass('owl-carousel'); 134 flat.tstSlider.owlCarousel({ 135 items: 3, 136 autoplay: true, 137 loop: true, 138 margin: 30, 139 dots: false, 140 nav: true, 141 navText: [ 142 '<i class="fa fa-arrow-left"></i>', 143 '<i class="fa fa-arrow-right"></i>' 144 ], 145 responsive: { 146 0: { 147 items: 1 148 }, 149 768: { 150 items: 2 151 }, 152 992: { 153 items: 3 154 } 155 } 156 }); 157 } 158 }; 159 160 161 162 // all functions of document ready 163 flat.docReady = () => { 164 flat.fnPreloader(); 165 flat.customCode(); 166 flat.fnPlugins(); 167 flat.fnSlider(); 168 }; 169 170 // all functions of window load 171 flat.winLoad = () => { 172 flat.fnPreloader(); 173 flat.wlPlugins(); 174 }; 175 176 177 $(document).ready(flat.docReady); 178 $(window).on('load', flat.winLoad); 179 180 181})(jQuery); // jshint ignore:line
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.