1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- (function () {
- var controller = $("#sidebar-menu").attr("route_controller");
- var action = $("#sidebar-menu").attr("route_action");
- var menus = $("#sidebar-menu").find("li[flag='menu']");
- $.each(menus,
- function (i, sub) {
- var controllerText = $(sub).find("span").eq(0).html();
- if (controllerText === controller) {
- $(sub).addClass("active");
- $(sub).addClass("menu-open");
- var actionTexts = $(sub).find(".treeview-menu").find("li");
- $.each(actionTexts, function (i, obj) {
- var txt = $(obj).text().trim();
- if (txt === action) {
- $(obj).addClass("active");
- }
- });
- }
- });
- })();
- $(function () {
- 'use strict';
- $('[data-toggle="control-sidebar"]').controlSidebar();
- $('[data-toggle="push-menu"]').pushMenu();
- var $pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu');
- var $controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar');
- var $layout = $('body').data('lte.layout');
- $(window).on('load',
- function () {
- // Reinitialize variables on load
- $pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu');
- $controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar');
- $layout = $('body').data('lte.layout');
- });
- function changeLayout(cls) {
- if (cls === "full") {
- if (!window.ScreenFull) {
- window.ScreenFull = "full";
- launchFullscreen(document.documentElement);
- } else {
- window.ScreenFull = undefined;
- exitFullscreen();
- }
- return;
- }
- $('body').toggleClass(cls);
- $layout.fixSidebar();
- if ($('body').hasClass('fixed') && cls === 'fixed') {
- $pushMenu.expandOnHover();
- $layout.activate();
- }
- $controlSidebar.fix();
- }
- });
|