Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:58:26

0001 /*

0002 Template Name: Admin Template

0003 Author: Wrappixel

0004 

0005 File: js

0006 */
0007 // ============================================================== 

0008 // Auto select left navbar

0009 // ============================================================== 

0010 $(function() {
0011     "use strict";
0012      var url = window.location + "";
0013         var path = url.replace(window.location.protocol + "//" + window.location.host + "/", "");
0014         var element = $('ul#sidebarnav a').filter(function() {
0015             return this.href === url || this.href === path;// || url.href.indexOf(this.href) === 0;

0016         });
0017         element.parentsUntil(".sidebar-nav").each(function (index)
0018         {
0019             if($(this).is("li") && $(this).children("a").length !== 0)
0020             {
0021                 $(this).children("a").addClass("active");
0022                 $(this).parent("ul#sidebarnav").length === 0
0023                     ? $(this).addClass("active")
0024                     : $(this).addClass("selected");
0025             }
0026             else if(!$(this).is("ul") && $(this).children("a").length === 0)
0027             {
0028                 $(this).addClass("selected");
0029                 
0030             }
0031             else if($(this).is("ul")){
0032                 $(this).addClass('in');
0033             }
0034             
0035         });
0036 
0037     element.addClass("active"); 
0038     $('#sidebarnav a').on('click', function (e) {
0039         
0040             if (!$(this).hasClass("active")) {
0041                 // hide any open menus and remove all other classes

0042                 $("ul", $(this).parents("ul:first")).removeClass("in");
0043                 $("a", $(this).parents("ul:first")).removeClass("active");
0044                 
0045                 // open our new menu and add the open class

0046                 $(this).next("ul").addClass("in");
0047                 $(this).addClass("active");
0048                 
0049             }
0050             else if ($(this).hasClass("active")) {
0051                 $(this).removeClass("active");
0052                 $(this).parents("ul:first").removeClass("active");
0053                 $(this).next("ul").removeClass("in");
0054             }
0055     })
0056     $('#sidebarnav >li >a.has-arrow').on('click', function (e) {
0057         e.preventDefault();
0058     });
0059     
0060 });