Blame view
app/scripts/inspinia.js
1.77 KB
e4e496d13
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
/** * INSPINIA - Responsive Admin Theme * 2.7 * * Custom scripts */ $(document).ready(function () { // Full height of sidebar function fix_height() { var heightWithoutNavbar = $("body > #wrapper").height() - 61; $(".sidebar-panel").css("min-height", heightWithoutNavbar + "px"); var navbarHeight = $('nav.navbar-default').height(); var wrapperHeigh = $('#page-wrapper').height(); if(navbarHeight > wrapperHeigh){ $('#page-wrapper').css("min-height", navbarHeight + "px"); } if(navbarHeight < wrapperHeigh){ $('#page-wrapper').css("min-height", $(window).height() + "px"); } if ($('body').hasClass('fixed-nav')) { if (navbarHeight > wrapperHeigh) { $('#page-wrapper').css("min-height", navbarHeight + "px"); } else { $('#page-wrapper').css("min-height", $(window).height() - 60 + "px"); } } } $(window).bind("load resize scroll", function() { if(!$("body").hasClass('body-small')) { fix_height(); } }); // Move right sidebar top after scroll $(window).scroll(function(){ if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav') ) { $('#right-sidebar').addClass('sidebar-top'); } else { $('#right-sidebar').removeClass('sidebar-top'); } }); setTimeout(function(){ fix_height(); }); }); // Minimalize menu when screen is less than 768px $(window).bind("load resize", function () { if ($(document).width() < 769) { $('body').addClass('body-small') } else { $('body').removeClass('body-small') } }); |