PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.12.4
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.12.4
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 / store / index.js

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

130 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { reactive } from "vue";
2
3 const store = ({
4 state: reactive({
5 showDrawer : null,
6 activeStepId : null,
7 activeStepTitle : null,
8 activeFunnelId : null,
9 component : null,
10 type : null,
11 showAlert : null,
12 isRemoteFunnels : null,
13 showLoader : null,
14 isGlobalFunnel : null,
15 isOrderbumpActive : null,
16 noProductTagSteps : null,
17 isEnableGbf : null,
18 componentMeta : null,
19 }),
20 getters: {
21 getShowDrawer() {
22 return store.state.showDrawer
23 },
24 getIsRemoteFunnel() {
25 return store.state.isRemoteFunnels
26 },
27 getActiveStepId() {
28 return store.state.activeStepId
29 },
30 getActiveStepTitle() {
31 return store.state.activeStepTitle
32 },
33 getActiveFunnelId() {
34 return store.state.activeFunnelId
35 },
36 getComponent() {
37 return store.state.component
38 },
39 getType() {
40 return store.state.type
41 },
42 getShowAlert() {
43 return store.state.showAlert
44 },
45 getIsGlobalFunnel() {
46 return store.state.isGlobalFunnel
47 },
48 getIsOrderbumpActive() {
49 return store.state.isOrderbumpActive
50 },
51 getNoProductTagSteps() {
52 return store.state.noProductTagSteps
53 },
54 getIsEnableGbf() {
55 return store.state.isEnableGbf
56 },
57 getComponentMeta() {
58 return store.state.componentMeta
59 },
60 getShowLoader() {
61 return store.state.showLoader
62 }
63 },
64 mutations: {
65 toggleDrawer() {
66 store.state.showDrawer = !store.state.showDrawer
67 },
68 openDrawerLoader() {
69 store.state.showLoader = true
70 },
71 closeDrawerLoader() {
72 store.state.showLoader = false
73 },
74 setActiveStepId(stepID) {
75 store.state.activeStepId = String(stepID)
76 },
77 setActiveStepTitle(stepTitle) {
78 store.state.activeStepTitle = String(stepTitle)
79 },
80 setActiveFunnelId(funnelID) {
81 store.state.activeFunnelId = String(funnelID)
82 },
83 setComponent(component) {
84 store.state.component = component
85 },
86 setComponentMeta(meta) {
87 store.state.componentMeta = meta
88 },
89 toggleAlert() {
90 store.state.showAlert = !store.state.showAlert
91 },
92 getComponent() {
93 return store.state.component
94 },
95 toggleGlobalFunnel() {
96 store.state.isGlobalFunnel = !store.state.isGlobalFunnel
97 },
98 toggleGlobalFunnelButton() {
99 store.state.isEnableGbf = !store.state.isEnableGbf
100 },
101 t(string, domain) {
102 return __(string, domain)
103 },
104 },
105 actions: {
106 initializeStore() {
107 store.state.showDrawer = false
108 store.state.activeStepId = 0
109 store.state.activeStepTitle = ''
110 store.state.activeFunnelId = 0
111 store.state.component = null
112 store.state.type = ''
113 store.state.showAlert = ''
114 store.state.isRemoteFunnels = false
115 store.state.showLoader = false
116 store.state.isGlobalFunnel = window.WPFunnelVars.isGlobalFunnel
117 store.state.isOrderbumpActive = false
118 store.state.noProductTagSteps = []
119 store.state.isEnableGbf = window.WPFunnelVars.isGbf === '1'
120 store.state.componentMeta = {
121 nodeID: '',
122 node_identifier: '',
123 funnelID: '',
124 }
125 }
126 }
127 })
128
129 export default store ;
130