sb-admin-2.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*!
  2. * Start Bootstrap - SB Admin 2 v3.3.7+1 (http://startbootstrap.com/template-overviews/sb-admin-2)
  3. * Copyright 2013-2017 Start Bootstrap
  4. * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)
  5. */
  6. $(function() {
  7. $('#side-menu').metisMenu();
  8. });
  9. //Loads the correct sidebar on window load,
  10. //collapses the sidebar on window resize.
  11. // Sets the min-height of #page-wrapper to window size
  12. $(function() {
  13. $(window).bind("load resize", function() {
  14. var topOffset = 50;
  15. var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
  16. if (width < 768) {
  17. $('div.navbar-collapse').addClass('collapse');
  18. topOffset = 100; // 2-row-menu
  19. } else {
  20. $('div.navbar-collapse').removeClass('collapse');
  21. }
  22. var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
  23. height = height - topOffset;
  24. if (height < 1) height = 1;
  25. if (height > topOffset) {
  26. $("#page-wrapper").css("min-height", (height) + "px");
  27. }
  28. });
  29. var url = window.location;
  30. // var element = $('ul.nav a').filter(function() {
  31. // return this.href == url;
  32. // }).addClass('active').parent().parent().addClass('in').parent();
  33. var element = $('ul.nav a').filter(function() {
  34. return this.href == url;
  35. }).addClass('active').parent();
  36. /*
  37. while (true) {
  38. if (element.is('li')) {
  39. element = element.parent().addClass('in').parent();
  40. } else {
  41. break;
  42. }
  43. }
  44. */
  45. $("#fossil-overview").addClass('in');
  46. //$("#slider-top").slider();
  47. //$("#slider-left").slider();
  48. //$("#slider-front").slider();
  49. });