// cleaned admin-theme.js - added date range picker
This commit is contained in:
@@ -33,23 +33,23 @@ $( document ).ready(function() {
|
||||
$('.maintab').not('.active').closest('.submenu').hide();
|
||||
$('#nav-sidebar li.maintab.has_submenu').append('<span class="submenu_expand"></span>');
|
||||
$('#nav-sidebar .submenu_expand').on('click',function(){
|
||||
var $navId = $(this).parent();
|
||||
$('.submenu-collapse').remove();
|
||||
if($('.expanded').length ){
|
||||
$('.expanded > ul').slideUp(
|
||||
'fast',
|
||||
function(){
|
||||
var $target = $('.expanded');
|
||||
$target.removeClass('expanded');
|
||||
$($navId).not($target).not('.active').addClass('expanded');
|
||||
$($navId).not($target).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
$($navId).not('.active').addClass('expanded');
|
||||
$($navId).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
var $navId = $(this).parent();
|
||||
$('.submenu-collapse').remove();
|
||||
if($('.expanded').length ){
|
||||
$('.expanded > ul').slideUp(
|
||||
'fast',
|
||||
function(){
|
||||
var $target = $('.expanded');
|
||||
$target.removeClass('expanded');
|
||||
$($navId).not($target).not('.active').addClass('expanded');
|
||||
$($navId).not($target).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
$($navId).not('.active').addClass('expanded');
|
||||
$($navId).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
});
|
||||
}
|
||||
//nav top bar
|
||||
@@ -61,45 +61,47 @@ $( document ).ready(function() {
|
||||
$('.expanded').removeClass('expanded');
|
||||
|
||||
$('#nav-topbar').on('mouseenter', 'li.maintab.has_submenu',
|
||||
function(){
|
||||
$(this).addClass('expanded');
|
||||
});
|
||||
function(){
|
||||
$(this).addClass('expanded');
|
||||
});
|
||||
$('#nav-topbar').on('mouseleave', 'li.maintab.has_submenu',
|
||||
function(){
|
||||
$(this).removeClass('expanded');
|
||||
function(){
|
||||
$(this).removeClass('expanded');
|
||||
});
|
||||
|
||||
//todo hide element over menu width on load
|
||||
$('#nav-topbar').find('li.maintab').each(
|
||||
function(){
|
||||
function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//todo hide element over menu width on resize
|
||||
$(window).on('resize', function() {
|
||||
$('#nav-topbar ul.menu').find('li.maintab').each(function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
$('#nav-topbar ul.menu').find('li.maintab').each(function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//nav switch
|
||||
function navSwitch(){
|
||||
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed'))
|
||||
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed')){
|
||||
navTopbar();
|
||||
else
|
||||
} else {
|
||||
navSidebar();
|
||||
}
|
||||
}
|
||||
|
||||
//init menu
|
||||
if ($('body').hasClass('page-sidebar'))
|
||||
if ($('body').hasClass('page-sidebar')){
|
||||
navSidebar();
|
||||
else if ($('body').hasClass('page-topbar'))
|
||||
} else if ($('body').hasClass('page-topbar')) {
|
||||
navTopbar();
|
||||
}
|
||||
|
||||
//tooltip
|
||||
$('.label-tooltip').tooltip();
|
||||
@@ -115,9 +117,9 @@ $( document ).ready(function() {
|
||||
{
|
||||
$('#go-top:hidden').stop(true, true).fadeIn();
|
||||
$('#go-top:hidden').removeClass('hide');
|
||||
}
|
||||
else
|
||||
} else {
|
||||
$('#go-top').stop(true, true).fadeOut();
|
||||
}
|
||||
}
|
||||
|
||||
$("#go-top").click(function() {
|
||||
@@ -128,5 +130,4 @@ $( document ).ready(function() {
|
||||
animateGoTop();
|
||||
});
|
||||
animateGoTop();
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user