1(function($) { 2 "use strict"; 3 4 //Color-Theme 5 $(document).on("click", "a[data-theme]", function() { 6 $("head link#theme").attr("href", $(this).data("theme")); 7 $(this).toggleClass('active').siblings().removeClass('active'); 8 }); 9 10 11 // FAQ Accordion 12 $(document).on("click", '[data-bs-toggle="collapse"]', function() { 13 $(this).toggleClass('active').siblings().removeClass('active'); 14 }); 15 16 17 // ______________Full screen 18 $(document).on("click", ".fullscreen-button", function toggleFullScreen() { 19 $('html').addClass('fullscreen-button'); 20 if ((document.fullScreenElement !== undefined && document.fullScreenElement === null) || (document.msFullscreenElement !== undefined && document.msFullscreenElement === null) || (document.mozFullScreen !== undefined && !document.mozFullScreen) || (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen)) { 21 if (document.documentElement.requestFullScreen) { 22 document.documentElement.requestFullScreen(); 23 } else if (document.documentElement.mozRequestFullScreen) { 24 document.documentElement.mozRequestFullScreen(); 25 } else if (document.documentElement.webkitRequestFullScreen) { 26 document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); 27 } else if (document.documentElement.msRequestFullscreen) { 28 document.documentElement.msRequestFullscreen(); 29 } 30 } else { 31 $('html').removeClass('fullscreen-button'); 32 if (document.cancelFullScreen) { 33 document.cancelFullScreen(); 34 } else if (document.mozCancelFullScreen) { 35 document.mozCancelFullScreen(); 36 } else if (document.webkitCancelFullScreen) { 37 document.webkitCancelFullScreen(); 38 } else if (document.msExitFullscreen) { 39 document.msExitFullscreen(); 40 } 41 } 42 }) 43 44 // ______________ PAGE LOADING 45 $(window).on("load", function(e) { 46 $("#global-loader").fadeOut("slow"); 47 }) 48 49 // ______________ BACK TO TOP BUTTON 50 $(window).on("scroll", function(e) { 51 if ($(this).scrollTop() > 0) { 52 $('#back-to-top').fadeIn('slow'); 53 } else { 54 $('#back-to-top').fadeOut('slow'); 55 } 56 }); 57 $(document).on("click", "#back-to-top", function(e) { 58 $("html, body").animate({ 59 scrollTop: 0 60 }, 0); 61 return false; 62 }); 63 64 65 // ______________ COVER IMAGE 66 $(".cover-image").each(function() { 67 var attr = $(this).attr('data-bs-image-src'); 68 if (typeof attr !== typeof undefined && attr !== false) { 69 $(this).css('background', 'url(' + attr + ') center center'); 70 } 71 }); 72 73 // ______________Quantity Cart Increase & Descrease 74 $(function () { 75 $('.add').on('click',function(){ 76 var $qty=$(this).closest('div').find('.qty'); 77 var currentVal = parseInt($qty.val()); 78 if (!isNaN(currentVal)) { 79 $qty.val(currentVal + 1); 80 } 81 }); 82 $('.minus').on('click',function(){ 83 var $qty=$(this).closest('div').find('.qty'); 84 var currentVal = parseInt($qty.val()); 85 if (!isNaN(currentVal) && currentVal > 0) { 86 $qty.val(currentVal - 1); 87 } 88 }); 89 }); 90 91 // ______________Chart-circle 92 if ($('.chart-circle').length) { 93 $('.chart-circle').each(function() { 94 let $this = $(this); 95 $this.circleProgress({ 96 fill: { 97 color: $this.attr('data-bs-color') 98 }, 99 size: $this.height(), 100 startAngle: -Math.PI / 4 * 2, 101 emptyFill: 'rgba(119, 119, 142, 0.2)', 102 lineCap: 'round' 103 }); 104 }); 105 } 106 107 // __________MODAL 108 // showing modal with effect 109 $('.modal-effect').on('click', function(e) { 110 e.preventDefault(); 111 var effect = $(this).attr('data-bs-effect'); 112 $('#modaldemo8').addClass(effect); 113 }); 114 // hide modal with effect 115 $('#modaldemo8').on('hidden.bs.modal', function(e) { 116 $(this).removeClass(function(index, className) { 117 return (className.match(/(^|\s)effect-\S+/g) || []).join(' '); 118 }); 119 }); 120 121 // ______________ CARD 122 const DIV_CARD = 'div.card'; 123 124 // ___________TOOLTIP 125 var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) 126 var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { 127 return new bootstrap.Tooltip(tooltipTriggerEl) 128 }) 129 130 // __________POPOVER 131 var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')) 132 var popoverList = popoverTriggerList.map(function (popoverTriggerEl) { 133 return new bootstrap.Popover(popoverTriggerEl) 134 }) 135 // By default, Bootstrap doesn't auto close popover after appearing in the page 136 $(document).on('click', function (e) { 137 $('[data-toggle="popover"],[data-original-title]').each(function () { 138 //the 'is' for buttons that trigger popups 139 //the 'has' for icons within a button that triggers a popup 140 if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { 141 (($(this).popover('hide').data('bs.popover')||{}).inState||{}).click = false // fix for BS 3.3.6 142 } 143 144 }); 145 }); 146 147 // ______________ FUNCTION FOR REMOVE CARD 148 $(document).on('click', '[data-bs-toggle="card-remove"]', function(e) { 149 let $card = $(this).closest(DIV_CARD); 150 $card.remove(); 151 e.preventDefault(); 152 return false; 153 }); 154 155 156 // ______________ FUNCTIONS FOR COLLAPSED CARD 157 $(document).on('click', '[data-bs-toggle="card-collapse"]', function(e) { 158 let $card = $(this).closest(DIV_CARD); 159 $card.toggleClass('card-collapsed'); 160 e.preventDefault(); 161 return false; 162 }); 163 164 // ______________ CARD FULL SCREEN 165 $(document).on('click', '[data-bs-toggle="card-fullscreen"]', function(e) { 166 let $card = $(this).closest(DIV_CARD); 167 $card.toggleClass('card-fullscreen').removeClass('card-collapsed'); 168 e.preventDefault(); 169 return false; 170 }); 171 172 173 //Input file-browser 174 $(document).on('change', '.file-browserinput', function() { 175 var input = $(this), 176 numFiles = input.get(0).files ? input.get(0).files.length : 1, 177 label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); 178 input.trigger('fileselect', [numFiles, label]); 179 });// We can watch for our custom `fileselect` event like this 180 181 //______File Upload 182 $('.file-browserinput').on('fileselect', function(event, numFiles, label) { 183 var input = $(this).parents('.input-group').find(':text'), 184 log = numFiles > 1 ? numFiles + ' files selected' : label; 185 if( input.length ) { 186 input.val(log); 187 } else { 188 if( log ) alert(log); 189 } 190 }); 191 192 193 194 // ______________ SWITCHER-toggle ______________// 195
196 $('.layout-setting').on("click", function(e) { 197 if (document) { 198 $('body').toggleClass('dark-mode'); 199 } else { 200 $('body').removeClass('dark-mode'); 201 $('body').addClass('light-mode'); 202 } 203 }); 204 205 /*Theme Layout*/ 206 // $('body').addClass('dark-mode'); 207 // $('body').addClass ('light-mode'); 208 209 /*Header-styles Mode*/ 210 // $('body').addClass('light-header'); 211 // $('body').addClass('color-header'); 212 // $('body').addClass('dark-header'); 213 // $('body').addClass('gradient-header'); 214 215 /*Leftmenu-styles Mode*/ 216 // $('body').addClass('light-menu'); 217 // $('body').addClass('color-menu'); 218 // $('body').addClass('dark-menu'); 219 // $('body').addClass('gradient-menu'); 220 221 /*Horizontal-menu Mode*/ 222 // $('body').addClass('light-hormenu'); 223 // $('body').addClass('color-hormenu'); 224 // $('body').addClass('dark-hormenu'); 225 // $('body').addClass('gradient-hormenu'); 226 227 /*Layout-width Styles*/ 228 // $('body').addClass('layout-fullwidth'); 229 // $('body').addClass('layout-boxed'); 230 231 /*Header-Position Styles*/ 232 // $('body').addClass('fixed-layout'); 233 // $('body').addClass('scrollable-layout'); 234 235})(jQuery); 236 237// Correct the body overflow when modal is open 238new MutationObserver(function (mutations) { 239 mutations.forEach(function (mutation) { 240 if (mutation.attributeName === "class") { 241 // if overflow change set to html 242 if (document.body.classList.contains("modal-open")) { 243 document.documentElement.style.overflow = "hidden"; 244 } else { 245 document.documentElement.style.overflow = "auto"; 246 } 247 } 248 }); 249}).observe(document.body, { attributes: true });
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.