sso

hplus.js 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // Custom scripts
  2. $(document).ready(function () {
  3. // MetsiMenu
  4. $('#side-menu').metisMenu();
  5. // Collapse ibox function
  6. $('.collapse-link').click( function() {
  7. var ibox = $(this).closest('div.ibox');
  8. var button = $(this).find('i');
  9. var content = ibox.find('div.ibox-content');
  10. // var secondary_menu = $(this).find('.nav>li>ul>li');
  11. content.slideToggle(200);
  12. button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
  13. ibox.toggleClass('').toggleClass('border-bottom');
  14. // secondary_menu.addClass('active').siblings().removeClass('active');
  15. setTimeout(function () {
  16. ibox.resize();
  17. ibox.find('[id^=map-]').resize();
  18. }, 50);
  19. });
  20. // Close ibox function
  21. $('.close-link').click( function() {
  22. var content = $(this).closest('div.ibox');
  23. content.remove();
  24. });
  25. // Small todo handler
  26. $('.check-link').click( function(){
  27. var button = $(this).find('i');
  28. var label = $(this).next('span');
  29. button.toggleClass('fa-check-square').toggleClass('fa-square-o');
  30. label.toggleClass('todo-completed');
  31. return false;
  32. });
  33. // Append config box / Only for demo purpose
  34. $.get("skin-config.html", function (data) {
  35. $('body').append(data);
  36. });
  37. // minimalize menu
  38. $('.navbar-minimalize').click(function () {
  39. $("body").toggleClass("mini-navbar");
  40. SmoothlyMenu();
  41. })
  42. // tooltips
  43. $('.tooltip-demo').tooltip({
  44. selector: "[data-toggle=tooltip]",
  45. container: "body"
  46. })
  47. // Move modal to body
  48. // Fix Bootstrap backdrop issu with animation.css
  49. $('.modal').appendTo("body")
  50. // Full height of sidebar
  51. function fix_height() {
  52. var heightWithoutNavbar = $("body > #wrapper").height() - 61;
  53. $(".sidebard-panel").css("min-height", heightWithoutNavbar + "px");
  54. }
  55. fix_height();
  56. $(window).bind("load resize click scroll", function() {
  57. if(!$("body").hasClass('body-small')) {
  58. fix_height();
  59. }
  60. })
  61. $("[data-toggle=popover]")
  62. .popover();
  63. });
  64. // For demo purpose - animation css script
  65. function animationHover(element, animation){
  66. element = $(element);
  67. element.hover(
  68. function() {
  69. element.addClass('animated ' + animation);
  70. },
  71. function(){
  72. //wait for animation to finish before removing classes
  73. window.setTimeout( function(){
  74. element.removeClass('animated ' + animation);
  75. }, 2000);
  76. });
  77. }
  78. // Minimalize menu when screen is less than 768px
  79. $(function() {
  80. $(window).bind("load resize", function() {
  81. if ($(this).width() < 769) {
  82. $('body').addClass('body-small')
  83. } else {
  84. $('body').removeClass('body-small')
  85. }
  86. })
  87. })
  88. function SmoothlyMenu() {
  89. if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) {
  90. // Hide menu in order to smoothly turn on when maximize menu
  91. $('#side-menu').hide();
  92. // For smoothly turn on menu
  93. setTimeout(
  94. function () {
  95. $('#side-menu').fadeIn(500);
  96. }, 100);
  97. } else if ($('body').hasClass('fixed-sidebar')){
  98. $('#side-menu').hide();
  99. setTimeout(
  100. function () {
  101. $('#side-menu').fadeIn(500);
  102. }, 300);
  103. } else {
  104. // Remove all inline style from jquery fadeIn function to reset menu state
  105. $('#side-menu').removeAttr('style');
  106. }
  107. }
  108. // Dragable panels
  109. function WinMove() {
  110. var element = "[class*=col]";
  111. var handle = ".ibox-title";
  112. var connect = "[class*=col]";
  113. $(element).sortable(
  114. {
  115. handle: handle,
  116. connectWith: connect,
  117. tolerance: 'pointer',
  118. forcePlaceholderSize: true,
  119. opacity: 0.8,
  120. })
  121. .disableSelection();
  122. };