123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- // Custom scripts
- $(document).ready(function () {
-
- // MetsiMenu
- $('#side-menu').metisMenu();
-
- // Collapse ibox function
- $('.collapse-link').click( function() {
- var ibox = $(this).closest('div.ibox');
- var button = $(this).find('i');
- var content = ibox.find('div.ibox-content');
- // var secondary_menu = $(this).find('.nav>li>ul>li');
-
-
- content.slideToggle(200);
- button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
- ibox.toggleClass('').toggleClass('border-bottom');
-
- // secondary_menu.addClass('active').siblings().removeClass('active');
-
- setTimeout(function () {
- ibox.resize();
- ibox.find('[id^=map-]').resize();
- }, 50);
- });
-
- // Close ibox function
- $('.close-link').click( function() {
- var content = $(this).closest('div.ibox');
- content.remove();
- });
-
- // Small todo handler
- $('.check-link').click( function(){
- var button = $(this).find('i');
- var label = $(this).next('span');
- button.toggleClass('fa-check-square').toggleClass('fa-square-o');
- label.toggleClass('todo-completed');
- return false;
- });
-
- // Append config box / Only for demo purpose
- $.get("skin-config.html", function (data) {
- $('body').append(data);
- });
-
- // minimalize menu
- $('.navbar-minimalize').click(function () {
- $("body").toggleClass("mini-navbar");
- SmoothlyMenu();
- })
-
- // tooltips
- $('.tooltip-demo').tooltip({
- selector: "[data-toggle=tooltip]",
- container: "body"
- })
-
- // Move modal to body
- // Fix Bootstrap backdrop issu with animation.css
- $('.modal').appendTo("body")
-
- // Full height of sidebar
- function fix_height() {
- var heightWithoutNavbar = $("body > #wrapper").height() - 61;
- $(".sidebard-panel").css("min-height", heightWithoutNavbar + "px");
- }
- fix_height();
-
- $(window).bind("load resize click scroll", function() {
- if(!$("body").hasClass('body-small')) {
- fix_height();
- }
- })
-
- $("[data-toggle=popover]")
- .popover();
- });
-
-
- // For demo purpose - animation css script
- function animationHover(element, animation){
- element = $(element);
- element.hover(
- function() {
- element.addClass('animated ' + animation);
- },
- function(){
- //wait for animation to finish before removing classes
- window.setTimeout( function(){
- element.removeClass('animated ' + animation);
- }, 2000);
- });
- }
-
- // Minimalize menu when screen is less than 768px
- $(function() {
- $(window).bind("load resize", function() {
- if ($(this).width() < 769) {
- $('body').addClass('body-small')
- } else {
- $('body').removeClass('body-small')
- }
- })
- })
-
- function SmoothlyMenu() {
- if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) {
- // Hide menu in order to smoothly turn on when maximize menu
- $('#side-menu').hide();
- // For smoothly turn on menu
- setTimeout(
- function () {
- $('#side-menu').fadeIn(500);
- }, 100);
- } else if ($('body').hasClass('fixed-sidebar')){
- $('#side-menu').hide();
- setTimeout(
- function () {
- $('#side-menu').fadeIn(500);
- }, 300);
- } else {
- // Remove all inline style from jquery fadeIn function to reset menu state
- $('#side-menu').removeAttr('style');
- }
- }
-
- // Dragable panels
- function WinMove() {
- var element = "[class*=col]";
- var handle = ".ibox-title";
- var connect = "[class*=col]";
- $(element).sortable(
- {
- handle: handle,
- connectWith: connect,
- tolerance: 'pointer',
- forcePlaceholderSize: true,
- opacity: 0.8,
- })
- .disableSelection();
- };
-
|