1/*================================================================================ 2 Item Name: Materialize - Material Design Admin Template 3 Version: 5.0 4 Author: PIXINVENT 5 Author URL: https://themeforest.net/user/pixinvent/portfolio 6================================================================================*/ 7 8$(function () { 9 "use strict"; 10 11 // Init collapsible 12 $(".collapsible").collapsible({ 13 accordion: true, 14 onOpenStart: function () { 15 // Removed open class first and add open at collapsible active 16 $(".collapsible > li.open").removeClass("open"); 17 setTimeout(function () { 18 $("#slide-out > li.active > a") 19 .parent() 20 .addClass("open"); 21 }, 10); 22 } 23 }); 24 25 // Add open class on init 26 $("#slide-out > li.active > a") 27 .parent() 28 .addClass("open"); 29 30 // Open active menu for multi level 31 if ($("li.active .collapsible-sub .collapsible").find("a.active").length > 0) { 32 $("li.active .collapsible-sub .collapsible") 33 .find("a.active") 34 .closest("div.collapsible-body") 35 .show(); 36 $("li.active .collapsible-sub .collapsible") 37 .find("a.active") 38 .closest("div.collapsible-body") 39 .closest("li") 40 .addClass("active"); 41 } 42 43 // Auto Scroll menu to the active item 44 var position; 45 if ( 46 $(".sidenav-main li a.active") 47 .parent("li.active") 48 .parent("ul.collapsible-sub").length > 0 49 ) { 50 position = $(".sidenav-main li a.active") 51 .parent("li.active") 52 .parent("ul.collapsible-sub") 53 .position(); 54 } else { 55 position = $(".sidenav-main li a.active") 56 .parent("li.active") 57 .position(); 58 } 59 setTimeout(function () { 60 if (position !== undefined) { 61 $(".sidenav-main ul") 62 .stop() 63 .animate({ scrollTop: position.top - 300 }, 300); 64 } 65 }, 300); 66 67 // Collapsible navigation menu 68 $(".nav-collapsible .navbar-toggler").click(function () { 69 // Toggle navigation expan and collapse on radio click 70 if ($(".sidenav-main").hasClass("nav-expanded") && !$(".sidenav-main").hasClass("nav-lock")) { 71 $(".sidenav-main").toggleClass("nav-expanded"); 72 $("#main").toggleClass("main-full"); 73 } else { 74 $("#main").toggleClass("main-full"); 75 } 76 // Set navigation lock / unlock with radio icon 77 if ( 78 $(this) 79 .children() 80 .text() == "radio_button_unchecked" 81 ) { 82 $(this) 83 .children() 84 .text("radio_button_checked"); 85 $(".sidenav-main").addClass("nav-lock"); 86 $(".navbar .nav-collapsible").addClass("sideNav-lock"); 87 } else { 88 $(this) 89 .children() 90 .text("radio_button_unchecked"); 91 $(".sidenav-main").removeClass("nav-lock"); 92 $(".navbar .nav-collapsible").removeClass("sideNav-lock"); 93 } 94 }); 95 96 // Expand navigation on mouseenter event 97 $(".sidenav-main.nav-collapsible, .navbar .brand-sidebar").mouseenter(function () { 98 if (!$(".sidenav-main.nav-collapsible").hasClass("nav-lock")) { 99 $(".sidenav-main.nav-collapsible, .navbar .nav-collapsible") 100 .addClass("nav-expanded") 101 .removeClass("nav-collapsed"); 102 $("#slide-out > li.close > a") 103 .parent() 104 .addClass("open") 105 .removeClass("close"); 106 107 setTimeout(function () { 108 // Open only if collapsible have the children 109 if ($(".collapsible .open").children().length > 1) { 110 $(".collapsible").collapsible("open", $(".collapsible .open").index()); 111 } 112 }, 100); 113 } 114 }); 115 116 // Collapse navigation on mouseleave event 117 $(".sidenav-main.nav-collapsible, .navbar .brand-sidebar").mouseleave(function () { 118 if (!$(".sidenav-main.nav-collapsible").hasClass("nav-lock")) { 119 var openLength = $(".collapsible .open").children().length; 120 $(".sidenav-main.nav-collapsible, .navbar .nav-collapsible") 121 .addClass("nav-collapsed") 122 .removeClass("nav-expanded"); 123 $("#slide-out > li.open > a") 124 .parent() 125 .addClass("close") 126 .removeClass("open"); 127 setTimeout(function () {
128 // Open only if collapsible have the children 129 if (openLength > 1) { 130 $(".collapsible").collapsible("close", $(".collapsible .close").index()); 131 } 132 }, 100); 133 } 134 }); 135 136 // Search class for focus 137 $(".header-search-input") 138 .focus(function () { 139 $(this) 140 .parent("div") 141 .addClass("header-search-wrapper-focus"); 142 }) 143 .blur(function () { 144 $(this) 145 .parent("div") 146 .removeClass("header-search-wrapper-focus"); 147 }); 148 149 //Search box form small screen 150 $(".search-button").click(function (e) { 151 if ($(".search-sm").is(":hidden")) { 152 $(".search-sm").show(); 153 $(".search-box-sm").focus(); 154 } else { 155 $(".search-sm").hide(); 156 $(".search-box-sm").val(""); 157 } 158 }); 159 $(".search-sm-close").click(function (e) { 160 $(".search-sm").hide(); 161 $(".search-box-sm").val(""); 162 }); 163 164 //Breadcrumbs with image 165 if ($("#breadcrumbs-wrapper").attr("data-image")) { 166 var imageUrl = $("#breadcrumbs-wrapper").attr("data-image"); 167 $("#breadcrumbs-wrapper").addClass("breadcrumbs-bg-image"); 168 $("#breadcrumbs-wrapper").css("background-image", "url(" + imageUrl + ")"); 169 } 170 171 // Check first if any of the task is checked 172 $("#task-card input:checkbox").each(function () { 173 checkbox_check(this); 174 }); 175 176 // Task check box 177 $("#task-card input:checkbox").change(function () { 178 checkbox_check(this); 179 }); 180 181 // Check Uncheck function 182 function checkbox_check(el) { 183 if (!$(el).is(":checked")) { 184 $(el) 185 .next() 186 .css("text-decoration", "none"); // or addClass 187 } else { 188 $(el) 189 .next() 190 .css("text-decoration", "line-through"); //or addClass 191 } 192 } 193 194 //Init tabs 195 $(".tabs").tabs(); 196 197 // Swipeable Tabs Demo Init 198 if ($("#tabs-swipe-demo").length) { 199 $("#tabs-swipe-demo").tabs({ 200 swipeable: true 201 }); 202 } 203 204 // Plugin initialization 205 206 $("select").formSelect(); 207 // Set checkbox on forms.html to indeterminate 208 var indeterminateCheckbox = document.getElementById("indeterminate-checkbox"); 209 if (indeterminateCheckbox !== null) indeterminateCheckbox.indeterminate = true; 210 211 // Materialize Slider 212 $(".slider").slider({ 213 full_width: true 214 }); 215 216 // Commom, Translation & Horizontal Dropdown 217 $(".dropdown-trigger").dropdown(); 218 219 // Commom, Translation 220 $(".dropdown-button").dropdown({ 221 inDuration: 300, 222 outDuration: 225, 223 constrainWidth: false, 224 hover: true, 225 gutter: 0, 226 coverTrigger: true, 227 alignment: "left" 228 // stopPropagation: false 229 }); 230 231 // Notification, Profile, Translation, Settings Dropdown & Horizontal Dropdown 232 $(".notification-button, .profile-button, .translation-button, .dropdown-settings, .dropdown-menu").dropdown({ 233 inDuration: 300, 234 outDuration: 225, 235 constrainWidth: false, 236 hover: false, 237 gutter: 0, 238 coverTrigger: false, 239 alignment: "right" 240 // stopPropagation: false 241 }); 242 243 // Fab 244 $(".fixed-action-btn").floatingActionButton(); 245 $(".fixed-action-btn.horizontal").floatingActionButton({ 246 direction: "left" 247 }); 248 $(".fixed-action-btn.click-to-toggle").floatingActionButton({ 249 direction: "left", 250 hoverEnabled: false 251 }); 252 $(".fixed-action-btn.toolbar").floatingActionButton({ 253 toolbarEnabled: true 254 }); 255 256 // Materialize Tabs 257 $(".tab-demo") 258 .show() 259 .tabs(); 260 $(".tab-demo-active") 261 .show() 262 .tabs(); 263 264 // Materialize scrollSpy 265 $(".scrollspy").scrollSpy(); 266 267 // Materialize tooltip 268 $(".tooltipped").tooltip({ 269 delay: 50 270 }); 271 272 //Main Left Sidebar Menu // sidebar-collapse 273 $(".sidenav").sidenav({ 274 edge: "left" // Choose the horizontal origin 275 }); 276 277 //Main Right Sidebar 278 $(".slide-out-right-sidenav").sidenav({ 279 edge: "right" 280 }); 281 282 //Main Right Sidebar Chat 283 $(".slide-out-right-sidenav-chat").sidenav({ 284 edge: "right" 285 }); 286 287 // Perfect Scrollbar 288 $("select") 289 .not(".disabled") 290 .select(); 291 var leftnav = $(".page-topbar").height(); 292 var leftnavHeight = window.innerHeight - leftnav; 293 var righttnav = $("#slide-out-right").height(); 294 295 if ($("#slide-out.leftside-navigation").length > 0) { 296 if (!$("#slide-out.leftside-navigation").hasClass("native-scroll")) { 297 var ps_leftside_nav = new PerfectScrollbar(".leftside-navigation", { 298 wheelSpeed: 2, 299 wheelPropagation: false, 300 minScrollbarLength: 20 301 }); 302 } 303 } 304 if ($(".slide-out-right-body").length > 0) { 305 var ps_slideout_right = new PerfectScrollbar(".slide-out-right-body, .chat-body .collection", { 306 suppressScrollX: true 307 }); 308 } 309 if ($(".chat-body .collection").length > 0) { 310 var ps_slideout_chat = new PerfectScrollbar(".chat-body .collection", { 311 suppressScrollX: true 312 }); 313 } 314 315 // Char scroll till bottom of the char content area 316 var chatScrollAuto = $("#right-sidebar-nav #slide-out-chat .chat-body .collection"); 317 if (chatScrollAuto.length > 0) { 318 chatScrollAuto[0].scrollTop = chatScrollAuto[0].scrollHeight; 319 } 320 321 // Fullscreen 322 function toggleFullScreen() { 323 if ( 324 (document.fullScreenElement && document.fullScreenElement !== null) || 325 (!document.mozFullScreen && !document.webkitIsFullScreen) 326 ) { 327 if (document.documentElement.requestFullScreen) { 328 document.documentElement.requestFullScreen(); 329 } else if (document.documentElement.mozRequestFullScreen) { 330 document.documentElement.mozRequestFullScreen(); 331 } else if (document.documentElement.webkitRequestFullScreen) { 332 document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); 333 } else if (document.documentElement.msRequestFullscreen) { 334 if (document.msFullscreenElement) { 335 document.msExitFullscreen(); 336 } else { 337 document.documentElement.msRequestFullscreen(); 338 } 339 } 340 } else { 341 if (document.cancelFullScreen) { 342 document.cancelFullScreen(); 343 } else if (document.mozCancelFullScreen) { 344 document.mozCancelFullScreen(); 345 } else if (document.webkitCancelFullScreen) { 346 document.webkitCancelFullScreen(); 347 } 348 } 349 } 350 351 $(".toggle-fullscreen").click(function () { 352 toggleFullScreen(); 353 }); 354 355 // Detect touch screen and enable scrollbar if necessary 356 function is_touch_device() {
357 try { 358 document.createEvent("TouchEvent"); 359 return true; 360 } catch (e) { 361 return false; 362 } 363 } 364 if (is_touch_device()) { 365 $("#nav-mobile").css({ 366 overflow: "auto" 367 }); 368 } 369 370 resizetable(); 371 372 373}); 374 375$(window).on("resize", function () { 376 resizetable(); 377}); 378 379function resizetable() { 380 if ($(window).width() < 976) { 381 if ($('.vertical-layout.vertical-gradient-menu .sidenav-dark .brand-logo').length > 0) { 382 $('.vertical-layout.vertical-gradient-menu .sidenav-dark .brand-logo img').attr('src', '/App_Themes/AdminNew45/assets/images/logo/materialize-logo-color.png'); 383 } 384 if ($('.vertical-layout.vertical-dark-menu .sidenav-dark .brand-logo').length > 0) { 385 $('.vertical-layout.vertical-dark-menu .sidenav-dark .brand-logo img').attr('src', '/App_Themes/AdminNew45/assets/images/logo/materialize-logo-color.png'); 386 } 387 if ($('.vertical-layout.vertical-modern-menu .sidenav-light .brand-logo').length > 0) { 388 $('.vertical-layout.vertical-modern-menu .sidenav-light .brand-logo img').attr('src', '/App_Themes/AdminNew45/assets/images/logo/logo.png'); 389 } 390 } 391 else { 392 if ($('.vertical-layout.vertical-gradient-menu .sidenav-dark .brand-logo').length > 0) { 393 $('.vertical-layout.vertical-gradient-menu .sidenav-dark .brand-logo img').attr('src', '/App_Themes/AdminNew45/assets/images/logo/materialize-logo.png'); 394 } 395 if ($('.vertical-layout.vertical-dark-menu .sidenav-dark .brand-logo').length > 0) { 396 $('.vertical-layout.vertical-dark-menu .sidenav-dark .brand-logo img').attr('src', '/App_Themes/AdminNew45/assets/images/logo/materialize-logo.png'); 397 } 398 if ($('.vertical-layout.vertical-modern-menu .sidenav-light .brand-logo').length > 0) { 399 $('.vertical-layout.vertical-modern-menu .sidenav-light .brand-logo img').attr('src', '/App_Themes/AdminNew45/assets/images/logo/logo-icon.png'); 400 } 401 } 402} 403resizetable(); 404 405// Add message to chat 406function slide_out_chat() { 407 var message = $(".search").val(); 408 if (message != "") { 409 var html = 410 '<li class="collection-item display-flex avatar justify-content-end pl-5 pb-0" data-target="slide-out-chat"><div class="user-content speech-bubble-right">' + 411 '<p class="medium-small">' + 412 message + 413 "</p>" + 414 "</div></li>"; 415 $("#right-sidebar-nav #slide-out-chat .chat-body .collection").append(html); 416 $(".search").val(""); 417 var charScroll = $("#right-sidebar-nav #slide-out-chat .chat-body .collection"); 418 if (charScroll.length > 0) { 419 charScroll[0].scrollTop = charScroll[0].scrollHeight; 420 } 421 } 422}
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.