content.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. var $parentNode = window.parent.document;
  2. function $childNode(name) {
  3. return window.frames[name]
  4. }
  5. // tooltips
  6. $('.tooltip-demo').tooltip({
  7. selector: "[data-toggle=tooltip]",
  8. container: "body"
  9. });
  10. // 使用animation.css修改Bootstrap Modal
  11. $('.modal').appendTo("body");
  12. $("[data-toggle=popover]").popover();
  13. //折叠ibox
  14. $('.collapse-link').click(function () {
  15. var ibox = $(this).closest('div.ibox');
  16. var button = $(this).find('i');
  17. var content = ibox.find('div.ibox-content');
  18. content.slideToggle(200);
  19. button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
  20. ibox.toggleClass('').toggleClass('border-bottom');
  21. setTimeout(function () {
  22. ibox.resize();
  23. ibox.find('[id^=map-]').resize();
  24. }, 50);
  25. });
  26. //关闭ibox
  27. $('.close-link').click(function () {
  28. var content = $(this).closest('div.ibox');
  29. content.remove();
  30. });
  31. //animation.css
  32. function animationHover(element, animation) {
  33. element = $(element);
  34. element.hover(
  35. function () {
  36. element.addClass('animated ' + animation);
  37. },
  38. function () {
  39. //动画完成之前移除class
  40. window.setTimeout(function () {
  41. element.removeClass('animated ' + animation);
  42. }, 2000);
  43. });
  44. }
  45. //拖动面板
  46. function WinMove() {
  47. var element = "[class*=col]";
  48. var handle = ".ibox-title";
  49. var connect = "[class*=col]";
  50. $(element).sortable({
  51. handle: handle,
  52. connectWith: connect,
  53. tolerance: 'pointer',
  54. forcePlaceholderSize: true,
  55. opacity: 0.8,
  56. })
  57. .disableSelection();
  58. };