PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 2.8.16
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v2.8.16
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / admin / modules / template-library / js / templates.js

templates.js in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 2.8.16, at admin/modules/template-library/js/templates.js

79 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { createApp } from "vue";
2 import store from './store'
3 var j = jQuery.noConflict()
4 import TemplatesLibrary from '../Components/TemplatesLibrary'
5
6 if(document.getElementById("templates-library")){
7 const app = createApp(TemplatesLibrary);
8 app.config.globalProperties.$store = store
9 app.mount("#templates-library");
10 store.actions.initializeStore()
11 }
12
13 j(document).ready(function (j) {
14
15 let TemplateLibrary = function() {
16 j('#wpfnl-tab-create_funnel, .add-new-funnel-btn').on('click', this.showTemplateLibrary)
17 j('.wpfnl-modal-close').on('click', this.closeTemplateLibraryModal)
18 j('#create-first-step, #add-new-step').on('click', this.getStepTemplates)
19 }
20
21 /**
22 * show template library
23 *
24 * @param e
25 */
26 TemplateLibrary.prototype.showTemplateLibrary = function(e) {
27 e.preventDefault();
28 j('#create-funnel-loader').addClass('show');
29 j('#template-library-modal').show();
30 j('#wpfnl-create-funnel__inner-content').show();
31 j('#wpfnl-create-steps_inner-content').hide();
32
33 j('.wpfnl-dashboard__header:not(.create-funnel__header)').hide();
34 j('.wpfnl-dashboard__inner-content').hide();
35 j('.wpfnl-funnel-settings__inner-content').hide();
36 }
37
38 /**
39 * get all step templates
40 *
41 * @param e
42 */
43 TemplateLibrary.prototype.getStepTemplates = function(e) {
44 e.preventDefault();
45 j('#wpfnl-create-funnel__inner-content').hide();
46 j('#wpfnl-create-steps_inner-content').show();
47 j('#template-library-modal').show();
48
49 //---for steps---
50 j('.steps-page__content').addClass('p0');
51 j('.wpfnl-single-step__content').hide();
52 j('.steps-settings').hide();
53 j('div.create-first-step').hide();
54 }
55
56
57 /**
58 * close template modals
59 *
60 * @param e
61 */
62 TemplateLibrary.prototype.closeTemplateLibraryModal = function (e) {
63 e.preventDefault();
64 j('#template-library-modal').hide();
65 j('#create-funnel-loader').removeClass('show');
66
67 j('.wpfnl-dashboard__header:not(.create-funnel__header)').show();
68 j('.wpfnl-dashboard__inner-content').show();
69 j('.wpfnl-funnel-settings__inner-content').show();
70
71 //---for steps---
72 j('.steps-page__content').removeClass('p0');
73 j('.wpfnl-single-step__content').show();
74 j('.steps-settings').show();
75 j('div.create-first-step').show();
76 }
77 new TemplateLibrary();
78 })
79