Built files from Bizgaze WebServer
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. /** *************Init JS*********************
  2. TABLE OF CONTENTS
  3. ---------------------------
  4. 1.Ready function
  5. 2.Load function
  6. 3.Full height function
  7. 4.pangong function
  8. 5.Chat App function
  9. 6.Resize function
  10. ** ***************************************/
  11. "use strict";
  12. /*****Ready function start*****/
  13. $(document).ready(function () {
  14. pangong();
  15. /*Disabled*/
  16. $(document).on("click", "a.disabled,a:disabled", function (e) {
  17. return false;
  18. });
  19. });
  20. /*****Ready function end*****/
  21. /*****Load function start*****/
  22. $(window).on("load", function () {
  23. $(".preloader-it").delay(500).fadeOut("slow");
  24. });
  25. /*****Load function* end*****/
  26. /*Variables*/
  27. var height, width,
  28. $wrapper = $(".biz-wrapper"),
  29. $nav = $(".biz-nav"),
  30. $vertnaltNav = $(".biz-wrapper.biz-vertical-nav,.biz-wrapper.biz-alt-nav"),
  31. $horizontalNav = $(".biz-wrapper.biz-horizontal-nav"),
  32. $navbar = $(".biz-navbar");
  33. /***** pangong function start *****/
  34. var pangong = function () {
  35. /*Form Animation Icon*/
  36. $('.custom-form-animation .form-control').focus(function () {
  37. $(this).parents('.custom-form-animation').addClass('focused');
  38. });
  39. $('.custom-form-animation .form-control').attr('autocomplete', 'off');
  40. $('.custom-form-animation .form-control').blur(function () {
  41. var inputValue = $(this).val();
  42. if (inputValue == "")
  43. $(this).parents('.custom-form-animation').removeClass('focused');
  44. });
  45. /*Builder aside responsive*/
  46. $(document).on('click', '.left-aside-togglable', function (e) {
  47. $('.biz-bldr-wrap').toggleClass('bldr__aside__left__toggle');
  48. return false;
  49. });
  50. /*Counter Animation*/
  51. var counterAnim = $('.counter-anim');
  52. if (counterAnim.length > 0) {
  53. counterAnim.counterUp({
  54. delay: 10,
  55. time: 1000
  56. });
  57. }
  58. /*Navbar Collapse Animation*/
  59. var navbarNavAnchor = '.biz-nav .navbar-nav li a';
  60. $(document).on("click", navbarNavAnchor, function (e) {
  61. if ($(this).attr('aria-expanded') === "false")
  62. $(this).blur();
  63. $(this).parent().siblings().find('.collapse').collapse('hide');
  64. $(this).parent().find('.collapse').collapse('hide');
  65. });
  66. /*Card Remove*/
  67. $(document).on('click', '.card-close', function (e) {
  68. $(this).closest('.card').remove();
  69. return false;
  70. });
  71. /*Accordion js*/
  72. $(document).on('show.bs.collapse', '.accordion .collapse', function (e) {
  73. $(this).siblings('.card-header').addClass('activestate');
  74. });
  75. $(document).on('hide.bs.collapse', '.accordion .collapse', function (e) {
  76. $(this).siblings('.card-header').removeClass('activestate');
  77. });
  78. /*Navbar Collapse Animation*/
  79. var navbarNavAnchor = '.biz-main-menu .navbar-nav li a,.nav-vertical li a';
  80. $(document).on("click", navbarNavAnchor, function (e) {
  81. if ($(this).attr('aria-expanded') === "false")
  82. $(this).blur();
  83. $(this).parent().parent().siblings().find('.collapse').collapse('hide');
  84. $(this).parent().siblings().find('.collapse').collapse('hide');
  85. $(this).parent().find('.collapse').collapse('hide');
  86. });
  87. /*Icon Style Navbar*/
  88. $(document).on('click', '.biz__icon__menu .biz-main-menu .menu-content-wrap .nav-link', function (e) {
  89. $(this).parent().parent().find('.sunbnav-active').removeClass('sunbnav-active');
  90. $(this).parent().addClass('sunbnav-active');
  91. $wrapper.addClass('biz__submenu');
  92. var id = $(this).attr('data-target');
  93. $(".biz-submenu .subnav-list").removeClass('d-flex');
  94. $(".biz-submenu").find(id).addClass('d-flex');
  95. });
  96. $(document).on('click', '#pane_toggle_btn', function (e) {
  97. $wrapper.toggleClass('biz__submenu');
  98. $(window).trigger("resize");
  99. return;
  100. });
  101. $(document).on('click', '#close_pane', function (e) {
  102. $('.biz__icon__menu .biz-main-menu .navbar-nav').find('.sunbnav-active').removeClass('sunbnav-active');
  103. $wrapper.removeClass('biz__submenu');
  104. });
  105. var navbarNavAnchor = '.biz-submenu .navbar-nav li a';
  106. $(document).on("click", navbarNavAnchor, function (e) {
  107. if ($(this).attr('aria-expanded') === "false")
  108. $(this).blur();
  109. $(this).parent().siblings().find('.collapse').collapse('hide');
  110. $(this).parent().find('.collapse').collapse('hide');
  111. });
  112. $(document).on('click', '.btn-search-toggle', function (e) {
  113. $(this).closest('.nav-header').find('.collapse').collapse('toggle');
  114. return false;
  115. });
  116. $(document).on("input", ".nav-search input", function (e) {
  117. if (!$(this).val().length == 0) {
  118. $(this).closest('.input-group').find('.feather-icon.clear-search').show();
  119. $(this).closest('.input-group').find('.feather-icon.icon-search').hide();
  120. } else {
  121. $(this).closest('.input-group').find('.feather-icon.clear-search').hide();
  122. $(this).closest('.input-group').find('.feather-icon.icon-search').show();
  123. }
  124. return false;
  125. });
  126. $(document).on('click', '.nav-search .feather-icon.clear-search', function (e) {
  127. $(this).closest('.nav-header').find('input').val("");
  128. $(this).closest('.input-group').find('.feather-icon.icon-search').show();
  129. $(this).hide();
  130. return false;
  131. });
  132. $(document).on('click', '.nav-search .feather-icon.close-search', function (e) {
  133. $(this).closest('.header-wth-search').find('.nav-search').fadeOut();
  134. $(this).closest('.header-wth-search').find('.nav-header-text').css({ "opacity": "1", "pointer-events": "auto" });
  135. return false;
  136. });
  137. $(document).on('click', '.header-wth-search .btn-search-toggle', function (e) {
  138. $(this).closest('.nav-header').find('input').val("");
  139. $(this).closest('.nav-header').find('.feather-icon.clear-search').hide();
  140. $(this).closest('.header-wth-search').find('.feather-icon.icon-search').show();
  141. $(this).closest('.header-wth-search').find('.nav-header-text').css({ "opacity": "0", "pointer-events": "none" });
  142. $(this).closest('.header-wth-search').find('.nav-search').fadeIn();
  143. $(this).closest('.header-wth-search').find('.nav-search input').focus();
  144. });
  145. /*Drawer Js*/
  146. $(document).on('click', '.drawer-toggle-link', function (e) {
  147. /* New Code */
  148. $('.biz-wrapper2').addClass('biz-drawer-push biz-drawer-pushright');
  149. /* New Code */
  150. var targetDrawer = $(this).attr('data-target');
  151. $(this).addClass('active');
  152. $('.hk-drawer').css({ "box-shadow": "none" });
  153. $('.biz-drawer').removeClass('biz-drawer-toggle');
  154. $wrapper.remove('.biz-drawer-backdrop');
  155. $wrapper.removeClass(function (index, className) {
  156. return (className.match(/biz-drawer-\S+/g) || []).join(' ');
  157. });
  158. if ($(this).attr('data-drawer') == "push-normal") {
  159. if ($(targetDrawer).hasClass('drawer-left'))
  160. $wrapper.addClass('biz-drawer-push biz-drawer-pushleft');
  161. else
  162. $wrapper.addClass('biz-drawer-push biz-drawer-pushright');
  163. }
  164. else if ($(this).attr('data-drawer') == "push-wth-nav") {
  165. if ($(targetDrawer).hasClass('drawer-left'))
  166. $wrapper.addClass('biz-drawer-push biz-drawer-wth-nav-push biz-drawer-pushleft');
  167. else
  168. $wrapper.addClass('biz-drawer-push biz-drawer-wth-nav-push biz-drawer-pushright');
  169. }
  170. else if ($(this).attr('data-drawer') == "overlay") {
  171. $(targetDrawer).css({ "border": "none", "box-shadow": "0 8px 32px rgba(0, 0, 0, 0.1)" });
  172. if ($(this).attr('data-backdrop') == "")
  173. $wrapper.append('<div class="biz-drawer-backdrop"></div>');
  174. }
  175. $(targetDrawer).addClass('biz-drawer-toggle');
  176. $('#biz-wrapper').addClass('biz-drawer-pushright');
  177. $("#drawer_push").addClass("biz-drawer-toggle")
  178. return false;
  179. });
  180. $(document).on('click', '.biz-drawer-backdrop', function (e) {
  181. $(this).remove();
  182. $('.hk-drawer').css({ "box-shadow": "none" });
  183. $('.biz-drawer').removeClass('biz-drawer-toggle');
  184. $wrapper.removeClass(function (index, className) {
  185. return (className.match(/biz-drawer-\S+/g) || []).join(' ');
  186. });
  187. return false;
  188. });
  189. $(document).on('click', '.drawer-close', function (e) {
  190. /* New Code */
  191. $('.biz-wrapper2').removeClass('biz-drawer-push biz-drawer-pushright');
  192. /* New Code */
  193. $(this).closest('.biz-drawer').css({ "box-shadow": "none" });
  194. $('.bldr-body').removeClass('biz-body-margin-right');
  195. $('.biz-drawer-backdrop').remove();
  196. $(this).closest('.biz-drawer').removeClass('biz-drawer-toggle');
  197. $wrapper.removeClass(function (index, className) {
  198. return (className.match(/biz-drawer-\S+/g) || []).join(' ');
  199. });
  200. return false;
  201. });
  202. $(document).on('click', '.drawer-close', function (e) {
  203. var id = $(this).closest('.biz-drawer').attr('id');
  204. $('[data-target="#' + id + '"]').removeClass('active');
  205. $('#biz-wrapper').removeClass('biz-drawer-pushright');
  206. return false;
  207. });
  208. /*Settings panel Toggle*/
  209. $(document).on('click', '#settings_toggle_btn', function (e) {
  210. $wrapper.toggleClass('biz-settings-toggle');
  211. return false;
  212. });
  213. $(document).on('click', '#settings_panel_close', function (e) {
  214. $wrapper.removeClass('biz-settings-toggle');
  215. return false;
  216. });
  217. $(document).on('click', '#nav_light_select', function (e) {
  218. $nav.removeClass('biz-menu-dark').addClass('biz-menu-light');
  219. return false;
  220. });
  221. $(document).on('click', '#nav_dark_select', function (e) {
  222. $nav.removeClass('biz-menu-light').addClass('biz-menu-dark');
  223. return false;
  224. });
  225. $(document).on('click', '#nav_light_select,#nav_dark_select', function (e) {
  226. $('.biz-nav-select').find('.btn').removeClass('btn-outline-primary').addClass('btn-outline-light');
  227. $(this).removeClass('btn-outline-light').addClass('btn-outline-primary').blur();
  228. return false;
  229. });
  230. $(document).on('click', '#navtop_light_select,#navtop_dark_select', function (e) {
  231. $('.biz-navbar-select').find('.btn').removeClass('btn-outline-primary').addClass('btn-outline-light');
  232. $(this).removeClass('btn-outline-light').addClass('btn-outline-primary').blur();
  233. return false;
  234. });
  235. $(document).on('click', '#navtop_light_select', function (e) {
  236. $navbar.removeClass('navbar-dark').addClass('navbar-light').find('img.brand-img').attr('src', 'dist/img/logo-light.png');
  237. return false;
  238. });
  239. $(document).on('click', '#navtop_dark_select', function (e) {
  240. $navbar.removeClass('navbar-light').addClass('navbar-dark').find('img.brand-img').attr('src', 'dist/img/logo-dark.png');
  241. return false;
  242. });
  243. if ($('.scroll-nav-switch').length > 0) {
  244. $('.scroll-nav-switch').toggles({
  245. drag: true, // allow dragging the toggle between positions
  246. click: true, // allow clicking on the toggle
  247. text: {
  248. on: '', // text for the ON position
  249. off: '' // and off
  250. },
  251. on: false, // is the toggle ON on init
  252. animate: 250, // animation time (ms)
  253. easing: 'swing', // animation transition easing function
  254. checkbox: null, // the checkbox to toggle (for use in forms)
  255. clicker: null, // element that can be clicked on to toggle. removes binding from the toggle itself (use nesting)
  256. type: 'compact' // if this is set to 'select' then the select style toggle will be used
  257. });
  258. $('.scroll-nav-switch.toggle').on('toggle', function (e, active) {
  259. if (active) {
  260. $wrapper.addClass('scrollable-nav');
  261. } else {
  262. $wrapper.removeClass('scrollable-nav');
  263. }
  264. });
  265. }
  266. var navBarChk = ($('.biz-navbar').hasClass('navbar-dark')),
  267. navChk = ($('.biz-nav').hasClass('biz-menu-dark'))
  268. $(document).on('click', '#reset_settings', function (e) {
  269. if (navBarChk)
  270. $('#navtop_dark_select').click();
  271. else
  272. $('#navtop_light_select').click();
  273. if (navChk)
  274. $('#nav_dark_select').click();
  275. else
  276. $('#nav_light_select').click();
  277. $('.scroll-nav-switch').click();
  278. if ($('.scroll-nav-switch').find('.toggle-on').hasClass('active'))
  279. $('.scroll-nav-switch').click();
  280. return false;
  281. });
  282. /*Search form Collapse*/
  283. $(document).on('click', '#navbar_search_btn', function (e) {
  284. $('html,body').animate({ scrollTop: 0 }, 'slow');
  285. $(".navbar-search input").focus();
  286. $wrapper.addClass('navbar-search-toggle');
  287. $(window).trigger("resize");
  288. });
  289. $(document).on('click', '#navbar_search_close', function (e) {
  290. $wrapper.removeClass('navbar-search-toggle');
  291. $(window).trigger("resize");
  292. return false;
  293. });
  294. /*Slimscroll*/
  295. if ($('.nicescroll-bar').length > 0) {
  296. $('.nicescroll-bar').slimscroll({ height: '100%', color: '#d6d9da', disableFadeOut: true, borderRadius: 0, size: '6px', enableKeyNavigation: true, opacity: .8 });
  297. }
  298. //Report builder slimscroll
  299. $(document).on('click', '[data-target="adj_drawer_1"]', function (e) {
  300. if ($('.nicescroll-bar').length > 0) {
  301. $('.nicescroll-bar').slimscroll({ height: '100%', color: '#d6d9da', disableFadeOut: true, borderRadius: 0, size: '6px', enableKeyNavigation: true, opacity: .8 });
  302. }
  303. });
  304. /*Slimscroll Key Control*/
  305. $(".slimScrollDiv").hover(function () {
  306. $(this).find('[class*="nicescroll-bar"]').focus();
  307. }, function () {
  308. $(this).find('[class*="nicescroll-bar"]').blur();
  309. });
  310. /*Refresh Init Js*/
  311. var refreshMe = '.refresh';
  312. $(document).on("click", refreshMe, function (e) {
  313. var panelToRefresh = $(this).closest('.card').find('.refresh-container');
  314. var dataToRefresh = $(this).closest('.card').find('.panel-wrapper');
  315. var loadingAnim = panelToRefresh.find('.la-anim-1');
  316. panelToRefresh.show();
  317. setTimeout(function () {
  318. loadingAnim.addClass('la-animate');
  319. }, 100);
  320. function started() { } //function before timeout
  321. setTimeout(function () {
  322. function completed() { } //function after timeout
  323. panelToRefresh.fadeOut(800);
  324. setTimeout(function () {
  325. loadingAnim.removeClass('la-animate');
  326. }, 800);
  327. }, 1500);
  328. return false;
  329. });
  330. /*Fullscreen Init Js*/
  331. $(document).on("click", ".full-screen", function (e) {
  332. $(this).parents('.card').toggleClass('fullscreen');
  333. $(window).trigger("resize");
  334. return false;
  335. });
  336. /** Bizgaze **/
  337. /*Multi select Js*/
  338. $(document).on('click', '.multi-sel > li,.multi-sel > div', function (e) {
  339. if ($(this).hasClass('selected'))
  340. $(this).removeClass('selected');
  341. else
  342. $(this).addClass('selected');
  343. return false;
  344. });
  345. /*Bizgaze ext Js*/
  346. $(document).on('click', '.dataset-list-wrap #modalDataListItems .nav-item', function (e) {
  347. $(this).closest('.biz-new-report').find('.columns-list-wrap').addClass('active');
  348. return false;
  349. });
  350. $(document).on('click', '.close-columns-list', function (e) {
  351. $(this).closest('.columns-list-wrap').removeClass('active');
  352. return false;
  353. });
  354. $(document).on("click", ".save-draft", function (e) {
  355. $.notify({
  356. icon: 'ri-checkbox-line font-21 mr-10',
  357. message: "Report Saved in Draft",
  358. }, {
  359. type: "dismissible alert alert-inv alert-inv-primary",
  360. placement: {
  361. from: "top",
  362. align: "right"
  363. },
  364. animate: {
  365. enter: 'animated fadeInUp',
  366. exit: 'animated fadeOutUp'
  367. },
  368. delay: 500000,
  369. });
  370. });
  371. /*Add Sub Report*/
  372. $(document).on('click', '.add-sub-report', function (e) {
  373. $(this).closest('.modal-content').find('.modal-body').append('<div class="sub-report-block card"><header class="sub-report-head"><h6 class="required">Sub report</h6><i class="las la-braille dragger"></i></header><div class="report-body"><div class="form-group"><select class="form-control custom-select mb-10"><option selected>- Choose -</option><option value="1">Two</option><option value="2">Three</option></select><div class="repeater"><div data-repeater-list="category-group"><div class="form-row"><div class="col"><select class="form-control custom-select mb-10"><option selected>Main report column</option><option value="1">Two</option><option value="2">Three</option></select></div><div class="col-auto"><select class="form-control custom-select mb-10"><option value="1" selected>=</option><option value="2">Three</option></select></div><div class="col"><select class="form-control custom-select mb-10"><option selected>Sub report column</option><option value="1">Two</option><option value="2">Three</option></select></div><div class="col-auto"><button class="btn btn-icon btn-theme" data-repeater-create><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg></span></span></button></div></div><div data-repeater-item class="form-row"><div class="col"><input type="text" class="form-control mb-2" value="Main report column=Sub report column"></div><div class="col-auto"><a href="#" data-repeater-delete class="btn btn-icon btn-flush-danger flush-soft-hover btn-rounded"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg></span></span></a></div></div></div></div></div></div></div>');
  374. return false;
  375. });
  376. //Delete Subreport
  377. $(document).on('click', '.delete-report', function (e) {
  378. $(this).closest('.sub-report-block').remove();
  379. })
  380. /*Adjsent Drawer*/
  381. $(document).on('click', '.biz-adj-drawer-wrap > .adj-drawer-open', function (e) {
  382. $(this).closest('.biz-adj-drawer-wrap').find('.biz-adj-drawer').hide();
  383. var id = $(this).attr('data-target');
  384. var leftOffset = $('.bldr-aside-left').width(); var clickevent = $('.adj-drawer-open').attr('data-clickevent')
  385. $(this).closest('.biz-adj-drawer-wrap').find('#' + id).css({ 'left': leftOffset }).show();
  386. });
  387. $(document).on('click', '.biz-adj-drawer-wrap > .adj-drawer-open-parameters', function (e) {
  388. $(this).closest('.biz-adj-drawer-wrap').find('.biz-adj-drawer').hide();
  389. var id = $(this).attr('data-target');
  390. $('.drawer-header > .drawer-close.close').addClass('hidden');
  391. $(this).closest('.biz-adj-drawer-wrap').find('#' + id).css({ 'left': '0%', 'right': '0%', }).show();
  392. });
  393. $(document).on('click', '.btn-adj-drawer-close', function (e) {
  394. $('.drawer-header > .drawer-close.close').removeClass('hidden');
  395. $(this).closest('.biz-adj-drawer').hide();
  396. });
  397. /*Adjsent Mini Drawer*/
  398. $(document).on('click', '.biz-mini-adj-drawer-wrap > .adj-drawer-open', function (e) {
  399. $(this).closest('.biz-mini-adj-drawer-wrap').find('.biz-mini-adj-drawer').hide();
  400. var id = $(this).attr('data-target');
  401. var topOffset = $(this).offset().top;
  402. var leftOffset = $('.bldr-aside-left').width();
  403. var elementHeight = $(this).closest('.biz-mini-adj-drawer-wrap').find('#' + id).height();
  404. if (topOffset + elementHeight > height)
  405. $(this).closest('.biz-mini-adj-drawer-wrap').find('#' + id).css({ 'top': 'auto', 'bottom': 0, 'left': leftOffset }).show();
  406. else
  407. $(this).closest('.biz-mini-adj-drawer-wrap').find('#' + id).css({ 'top': topOffset, 'bottom': 'auto', 'left': leftOffset }).show();
  408. });
  409. $(document).on('click', '.btn-mini-drawer-close', function (e) {
  410. $(this).closest('.biz-mini-adj-drawer').hide();
  411. });
  412. $(document).on('click', '.dsl-block-wrap .dsl-block .dsl-block-close', function (e) {
  413. $(this).closest('.dsl-block').remove();
  414. });
  415. /*Dragula*/
  416. dragula([document.getElementById("sub_report")], {
  417. moves: function (el, container, handle) {
  418. return handle.classList.contains('sub-report-head');
  419. }
  420. });
  421. dragula([document.getElementById("tab_front")], {
  422. moves: function (el, container, handle) {
  423. return handle.classList.contains('sec-block-head');
  424. }
  425. });
  426. dragula([document.getElementById("sfl_1")], {
  427. moves: function (el, container, handle) {
  428. return handle.classList.contains('dragger');
  429. }
  430. });
  431. dragula([document.getElementById("sfl_2")], {
  432. moves: function (el, container, handle) {
  433. return handle.classList.contains('dragger');
  434. }
  435. });
  436. dragula([document.getElementById("sfl_3")], {
  437. moves: function (el, container, handle) {
  438. return handle.classList.contains('dragger');
  439. }
  440. });
  441. dragula([document.getElementById("sfl_4")], {
  442. moves: function (el, container, handle) {
  443. return handle.classList.contains('dragger');
  444. }
  445. });
  446. dragula([document.getElementById("sfl_5")], {
  447. moves: function (el, container, handle) {
  448. return handle.classList.contains('dragger');
  449. }
  450. });
  451. dragula([document.getElementById("sfl_6")], {
  452. moves: function (el, container, handle) {
  453. return handle.classList.contains('dragger');
  454. }
  455. });
  456. dragula([document.getElementById("sfl_7")], {
  457. moves: function (el, container, handle) {
  458. return handle.classList.contains('dragger');
  459. }
  460. });
  461. dragula([document.getElementById("sfl_8")], {
  462. moves: function (el, container, handle) {
  463. return handle.classList.contains('dragger');
  464. }
  465. });
  466. dragula([document.getElementById("sfl_9")], {
  467. moves: function (el, container, handle) {
  468. return handle.classList.contains('dragger');
  469. }
  470. });
  471. // Report Dragula
  472. $(document).on('click', '#headerLinkReportIcon', function (e) {
  473. dragula([document.getElementById("linkreport_modal")], {
  474. moves: function (el, container, handle) {
  475. return handle.classList.contains('sub-report-head');
  476. }
  477. });
  478. });
  479. dragula([document.getElementById("tab_front")], {
  480. moves: function (el, container, handle) {
  481. return handle.classList.contains('sec-block-head');
  482. }
  483. });
  484. $(document).on('click', '#groupby_selected_columns', function (e) {
  485. dragula([document.getElementById("groupby_selected_columns")], {
  486. moves: function (el, container, handle) {
  487. return handle.classList.contains('dragger');
  488. }
  489. });
  490. });
  491. $(document).on('click', '#categories_selected_columns', function (e) {
  492. dragula([document.getElementById("categories_selected_columns")], {
  493. moves: function (el, container, handle) {
  494. return handle.classList.contains('dragger');
  495. }
  496. });
  497. });
  498. $(document).on('click', '#xaxis_selected_columns', function (e) {
  499. dragula([document.getElementById("xaxis_selected_columns")], {
  500. moves: function (el, container, handle) {
  501. return handle.classList.contains('dragger');
  502. }
  503. });
  504. });
  505. $(document).on('click', '#yaxis_selected_columns', function (e) {
  506. dragula([document.getElementById("yaxis_selected_columns")], {
  507. moves: function (el, container, handle) {
  508. return handle.classList.contains('dragger');
  509. }
  510. });
  511. });
  512. $(document).on('click', '#selectedColumns', function (e) {
  513. dragula([document.getElementById("selectedColumns")], {
  514. moves: function (el, container, handle) {
  515. return handle.classList.contains('dragger');
  516. }
  517. });
  518. });
  519. $(document).on('click', '#tooltip_selected_columns', function (e) {
  520. dragula([document.getElementById("tooltip_selected_columns")], {
  521. moves: function (el, container, handle) {
  522. return handle.classList.contains('dragger');
  523. }
  524. });
  525. });
  526. /*Color Filter*/
  527. $(document).on("click", '.color-board .color-block', function (e) {
  528. $(this).closest('.color-board').find('.color-block').removeClass('selected');
  529. $(this).addClass('selected');
  530. return false;
  531. });
  532. /*Query Builder*/
  533. $(document).on("click", '.qry-builder-open', function (e) {
  534. $('.qry-builder-container').show();
  535. return false;
  536. });
  537. $(document).on("click", '.qry-builder-container header .close', function (e) {
  538. $('.qry-builder-container').hide();
  539. return false;
  540. });
  541. /*Builder aside responsive*/
  542. $(document).on('click', '.right-aside-togglable', function (e) {
  543. $('.biz-bldr-wrap').toggleClass('bldr__aside__right__toggle');
  544. $('.biz-wrapper').toggleClass('bldr__aside__right__toggle');
  545. $('.biz-wrapper .bldr-aside-right').toggleClass("biz-aside-margin-right");
  546. $(".bldr-body").toggleClass("biz-body-margin-right");
  547. return false;
  548. });
  549. /*Content editable*/
  550. $(document).on("click", '.inline-edit .inline-edit-btn', function (e) {
  551. $(this).closest('.inline-edit').find('.edit').attr("contenteditable", "true").focus();
  552. $(this).closest('.inline-edit').find('.edit').css("outline", "none");
  553. });
  554. $(document).on("focusout", ".inline-edit .edit", function (e) {
  555. $(this).attr("contenteditable", "false");
  556. });
  557. // Report Content Editable
  558. $(document).on("click", '#tooltip_selected_columns .inline-edit .inline-edit-btn', function (e) {
  559. $(this).closest('.inline-edit').find('.edit').removeAttr('disabled')
  560. $(this).closest('.inline-edit').find('.edit').addClass('input-styles');
  561. $(this).closest('.inline-edit').find('.reset-text').removeClass('hidden');
  562. });
  563. $(document).on("click", '#tooltip_selected_columns .inline-edit .reset-text', function (e) {
  564. $(this).closest('.inline-edit').find('.edit').attr('disabled', true);
  565. $(this).closest('.inline-edit').find('.edit').removeClass('input-styles');
  566. $(this).addClass('hidden');
  567. });
  568. /*Sub-Dropdown*/
  569. $('.dropdown-menu > .inner-dropdown-menu.dropdown > a').addClass('dropdown-toggle');
  570. $('.dropdown-menu a.dropdown-toggle').on('click', function (e) {
  571. if (!$(this).next().hasClass('show')) {
  572. $(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
  573. }
  574. var $subMenu = $(this).next(".dropdown-menu");
  575. $subMenu.toggleClass('show');
  576. $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) {
  577. $('.dropdown-menu > .dropdown .show').removeClass("show");
  578. });
  579. return false;
  580. });
  581. /*Coupon Modal*/
  582. $(document).on("click", '.coupon-modal-open', function (e) {
  583. var idTarget = $(this).attr('data-target');
  584. $('.timeline-wrap').addClass('d-none');
  585. $(idTarget).addClass('d-block');
  586. return false;
  587. });
  588. $(document).on("click", '.coupon-modal-close', function (e) {
  589. $('.timeline-wrap').removeClass('d-none');
  590. $(this).closest('.coupon-modal').removeClass('d-block');
  591. return false;
  592. });
  593. };
  594. /***** pangong function end *****/
  595. /***** Full height function start *****/
  596. var setHeightWidth = function () {
  597. height = window.innerHeight;
  598. width = window.innerWidth;
  599. /*Icon Nav Height for differnt brekpoints with Horizontal menu*/
  600. if (width > 1200) {
  601. if ($('.biz__icon__menu').hasClass('biz__nav__toggle'))
  602. $('.biz__icon__menu').removeClass('biz__nav__toggle');
  603. } else
  604. $('.biz__icon__menu').addClass('biz__submenu');
  605. //Right Tab Responsiveness below 1200 width
  606. $(function () {
  607. if ($(window).width() < 1200) {
  608. $('.biz-wrapper2 .drawer-close').trigger('click');
  609. }
  610. })
  611. /*Drawer Responsive JS*/
  612. if (width < 1200) {
  613. $wrapper.removeClass(function (index, className) {
  614. return (className.match(/biz-drawer-\S+/g) || []).join(' ');
  615. });
  616. $('.biz-drawer').removeClass('biz-drawer-toggle');
  617. $('.drawer-toggle-link').removeClass('active');
  618. } else {
  619. $("#form-builder-container .right-toggle-link").trigger('click');
  620. }
  621. };
  622. /***** Full height function end *****/
  623. /***** Resize function start *****/
  624. $(window).on("resize", function () {
  625. setHeightWidth();
  626. });
  627. $(window).trigger("resize");
  628. /***** Resize function end *****/
  629. /***** New Form Data *****/
  630. $(document).on('click', '.dsl-sec-block-wrap .dsl-block', function (e) {
  631. var hash = this.hash;
  632. if ($(this).hasClass('focused-block')) {
  633. $(this).removeClass('focused-block');
  634. $(hash).removeClass('focused');
  635. }
  636. else {
  637. $('.dsl-sec-block-wrap .dsl-block').removeClass('focused-block');
  638. $(this).addClass('focused-block');
  639. $('.form-sec-wrap').removeClass('focused');
  640. $(hash).addClass('focused');
  641. }
  642. });
  643. $(document).on('click', '.dsl-doc-type-wrap .dsl-block.selected', function (e) {
  644. var target = $(this).attr("data-target");
  645. console.log(target);
  646. if ($(this).hasClass('focused-block')) {
  647. $(this).removeClass('focused-block');
  648. $(target).removeClass('focused');
  649. }
  650. else {
  651. $('.dsl-doc-type-wrap .dsl-block.selected').removeClass('focused-block');
  652. $(this).addClass('focused-block');
  653. //$('.form-sec-block .form-group').removeClass('focused');
  654. $('.PropertyText').removeClass('focused');
  655. $(target).addClass('focused');
  656. }
  657. return false;
  658. });
  659. $(document).on('click', '.doc-type-close', function (e) {
  660. $(this).closest('.form-group').parent().remove();
  661. return false;
  662. });
  663. $(document).on('click', '.default-doc-type', function (e) {
  664. $('.already-created-doc').removeClass('default-doc');
  665. $(this).closest('.already-created-doc').addClass('default-doc');
  666. });
  667. var idCount = 0;
  668. $('.dsl-doc-type-wrap .dsl-block').each(function () {
  669. $(this).attr('id', 'doc_type_block_' + idCount);
  670. idCount++;
  671. });
  672. function hasClass(element, cls) {
  673. return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;
  674. }
  675. dragula([document.getElementById("drag_elements"), document.getElementById("drop_elements"), document.getElementById("drop_elements_2"), document.getElementById("drop_elements_3"), document.getElementById("drop_elements_4"), document.getElementById("drop_elements_5")], {
  676. copy: function (el, source) {
  677. return source === document.getElementById("drag_elements")
  678. },
  679. accepts: function (el, target) {
  680. return target !== document.getElementById("drag_elements")
  681. },
  682. moves: function (el, container, handle) {
  683. return handle.classList.contains('dragger')
  684. }
  685. }).on('drop', function (el, target) {
  686. if (hasClass(el, 'dsl-block'))
  687. $('#' + el.id).addClass('selected');
  688. if ($('.form-sec-block .dsl-block').length > 0) {
  689. $('#' + target.id).append('<div class="col-lg-4"><div class="form-group form-name"><div><div class="form-label-group"> <label> <span class="required"> ' + $('.form-sec-block .row').find('.dsl-block-name').text() + ' </span> </label><div class="form-group-action"> <a class="btn btn-xs btn-icon btn-flush-dark btn-rounded flush-soft-hover" href="#"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg></span></span></a> <a class="btn btn-xs btn-icon btn-flush-dark btn-rounded flush-soft-hover doc-type-close" href="#"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg></span></span></a></div></div> <input type="text" class="form-control"></div></div></div>');
  690. }
  691. $('.form-sec-block .row').find('.dsl-block').remove();
  692. });
  693. dragula([document.getElementById("drag_elements_2"), document.getElementById("drop_elements"), document.getElementById("drop_elements_2"), document.getElementById("drop_elements_3"), document.getElementById("drop_elements_4"), document.getElementById("drop_elements_5")], {
  694. copy: function (el, source) {
  695. return source === document.getElementById("drag_elements_2")
  696. },
  697. accepts: function (el, target) {
  698. return target !== document.getElementById("drag_elements_2")
  699. },
  700. moves: function (el, container, handle) {
  701. return handle.classList.contains('dragger')
  702. }
  703. }).on('drop', function (el, target) {
  704. if (hasClass(el, 'dsl-block'))
  705. $('#' + el.id).addClass('selected');
  706. if ($('.form-sec-block .dsl-block').length > 0) {
  707. $('#' + target.id).append('<div class="col-lg-4"><div class="form-group form-name"><div><div class="form-label-group"> <label> <span class="required"> ' + $('.form-sec-block .row').find('.dsl-block-name').text() + ' </span> </label><div class="form-group-action"> <a class="btn btn-xs btn-icon btn-flush-dark btn-rounded flush-soft-hover" href="#"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg></span></span></a> <a class="btn btn-xs btn-icon btn-flush-dark btn-rounded flush-soft-hover doc-type-close" href="#"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg></span></span></a></div></div> <input type="text" class="form-control"></div></div></div>');
  708. }
  709. $('.form-sec-block .row').find('.dsl-block').remove();
  710. });
  711. dragula([document.getElementById("drag_elements_3"), document.getElementById("drop_elements"), document.getElementById("drop_elements_2"), document.getElementById("drop_elements_3"), document.getElementById("drop_elements_4"), document.getElementById("drop_elements_5")], {
  712. copy: function (el, source) {
  713. return source === document.getElementById("drag_elements_3")
  714. },
  715. accepts: function (el, target) {
  716. return target !== document.getElementById("drag_elements_3")
  717. },
  718. moves: function (el, container, handle) {
  719. return handle.classList.contains('dragger')
  720. }
  721. }).on('drop', function (el, target) {
  722. if (hasClass(el, 'dsl-block'))
  723. $('#' + el.id).addClass('selected');
  724. if ($('.form-sec-block .dsl-block').length > 0) {
  725. $('#' + target.id).append('<div class="col-lg-4"><div class="form-group"><div><div class="form-label-group"> <label> <span class="required"> ' + $('.form-sec-block .row').find('.dsl-block-name').text() + ' </span> </label><div class="form-group-action"> <a class="btn btn-xs btn-icon btn-flush-dark btn-rounded flush-soft-hover" href="#"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg></span></span></a> <a class="btn btn-xs btn-icon btn-flush-dark btn-rounded flush-soft-hover doc-type-close" href="#"><span class="btn-icon-wrap"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg></span></span></a></div></div> <input type="text" class="form-control"></div></div></div>');
  726. }
  727. $('.form-sec-block .row').find('.dsl-block').remove();
  728. });
  729. dragula([document.getElementById("drop_elements"), document.getElementById("drop_elements_2"), document.getElementById("drop_elements_3"), document.getElementById("drop_elements_4"), document.getElementById("drop_elements_5")]);
  730. /***** New Form Data *****/