You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
4.9 KiB

  1. // ----------------------------------------------
  2. // # Search
  3. // ----------------------------------------------
  4. //(function () {
  5. // $('.fa-search').on('click', function () {
  6. // $('.search').fadeIn(500, function () {
  7. // $(this).toggleClass('search-toggle');
  8. // });
  9. // });
  10. // $('.search-close').on('click', function () {
  11. // $('.search').fadeOut(500, function () {
  12. // $(this).removeClass('search-toggle');
  13. // });
  14. // });
  15. //}());
  16. function AddCol() {
  17. $("form").addClass("col-md-12");
  18. }
  19. $(document).ready(function () {
  20. // Add body-small class if window less than 768px
  21. if ($(this).width() < 769) {
  22. $('body').addClass('body-small');
  23. } else {
  24. $('body').removeClass('body-small');
  25. }
  26. // MetsiMenu
  27. //$('#side-menu').metisMenu();
  28. // Minimalize menu
  29. $('.navbar-minimalize').click(function () {
  30. $("body").toggleClass("mini-navbar");
  31. });
  32. // $(".nano").nanoScroller();
  33. });
  34. //------------- Last sales locations -------------//
  35. $('#world-map').vectorMap({
  36. map: 'world_mill_en',
  37. scaleColors: ['#f7f9fe', '#29b6d8'],
  38. normalizeFunction: 'polynomial',
  39. hoverOpacity: 0.7,
  40. hoverColor: false,
  41. focusOn: {
  42. x: 0.5,
  43. y: 0.5,
  44. scale: 1.0
  45. },
  46. zoomMin: 0.85,
  47. markerStyle: {
  48. initial: {
  49. fill: '#df6a78',
  50. stroke: '#df6a78'
  51. }
  52. },
  53. backgroundColor: '#fff',
  54. regionStyle: {
  55. initial: {
  56. fill: '#dde1e7',
  57. "fill-opacity": 1,
  58. stroke: '#f7f9fe',
  59. "stroke-width": 0,
  60. "stroke-opacity": 0
  61. },
  62. hover: {
  63. "fill-opacity": 0.8
  64. },
  65. selected: {
  66. fill: 'yellow'
  67. }
  68. },
  69. markers: [
  70. //http://www.latlong.net/
  71. {latLng: [51.507351, -0.127758], name: 'London'},
  72. {latLng: [41.385064, 2.173403], name: 'Barcelona'},
  73. {latLng: [40.712784, -74.005941], name: 'New York'},
  74. {latLng: [-22.911632, -43.188286], name: 'Rio De Janeiro'},
  75. {latLng: [49.282729, -123.120738], name: 'Vancuver'},
  76. {latLng: [35.689487, 139.691706], name: 'Tokio'},
  77. {latLng: [55.755826, 37.617300], name: 'Moskva'},
  78. {latLng: [43.214050, 27.914733], name: 'Varna'},
  79. {latLng: [30.044420, 31.235712], name: 'Cairo'}
  80. ]
  81. });
  82. // Panels
  83. (function ($) {
  84. $(function () {
  85. $('.panel')
  86. .on('panel:toggle', function () {
  87. var $this,
  88. direction;
  89. $this = $(this);
  90. direction = $this.hasClass('panel-collapsed') ? 'Down' : 'Up';
  91. $this.find('.panel-body, .panel-footer')[ 'slide' + direction ](200, function () {
  92. $this[ (direction === 'Up' ? 'add' : 'remove') + 'Class' ]('panel-collapsed')
  93. });
  94. })
  95. .on('panel:dismiss', function () {
  96. var $this = $(this);
  97. if (!!($this.parent('div').attr('class') || '').match(/col-(xs|sm|md|lg)/g) && $this.siblings().length === 0) {
  98. $row = $this.closest('.row');
  99. $this.parent('div').remove();
  100. if ($row.children().length === 0) {
  101. $row.remove();
  102. }
  103. } else {
  104. $this.remove();
  105. }
  106. })
  107. .on('click', '[data-panel-toggle]', function (e) {
  108. e.preventDefault();
  109. $(this).closest('.panel').trigger('panel:toggle');
  110. })
  111. .on('click', '[data-panel-dismiss]', function (e) {
  112. e.preventDefault();
  113. $(this).closest('.panel').trigger('panel:dismiss');
  114. })
  115. /* Deprecated */
  116. .on('click', '.panel-actions a.fa-caret-up', function (e) {
  117. e.preventDefault();
  118. var $this = $(this);
  119. $this
  120. .removeClass('fa-caret-up')
  121. .addClass('fa-caret-down');
  122. $this.closest('.panel').trigger('panel:toggle');
  123. })
  124. .on('click', '.panel-actions a.fa-caret-down', function (e) {
  125. e.preventDefault();
  126. var $this = $(this);
  127. $this
  128. .removeClass('fa-caret-down')
  129. .addClass('fa-caret-up');
  130. $this.closest('.panel').trigger('panel:toggle');
  131. })
  132. .on('click', '.panel-actions a.fa-times', function (e) {
  133. e.preventDefault();
  134. var $this = $(this);
  135. $this.closest('.panel').trigger('panel:dismiss');
  136. });
  137. });
  138. })(jQuery);