$('.dropdown-toggle').dropdown();
$('#myModal').modal('show');

function autoFlashHeight(){
    $(".main-wrap").height($(window).height()-50 );
    $(".side-wrap").height($(window).height()-50 );
    $(".sidebar").height($(window).height()-50 );
};
$(window).resize(autoFlashHeight);

$(document).ready(function() {
  $(".class-title-first").click(function(){
    $(this).siblings().parent().siblings().toggle();
  });
});

$(".open-sidebar").on('click',function(){
  $(".side-wrap").animate({right:'0'},700);
  event.stopPropagation();  //防止冒泡
});

$("body").click(function(event){
       var e = event || window.event; //浏览器兼容性
       var elem = event.target || e.srcElement;
       // var ds = $('.side-wrap').css('right');
       // console.log(ds);
       while (elem) { //循环判断至跟节点，防止点击的是div子元素
           if (elem.className == "open-sidebar" || elem.className == "side-wrap") {
              return;
           }
           elem = elem.parentNode;
       }
      $(".side-wrap").animate({right: '-700px'},500);
      // event.stopPropagation();  //防止冒泡 
});

$(function () {
  $('[data-toggle="tooltip"]').tooltip();
});