Skip to content

Commit bba12e3

Browse files
committed
Update the store
1 parent 108fa23 commit bba12e3

File tree

1 file changed

+58
-53
lines changed

1 file changed

+58
-53
lines changed

src/store/index.js

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,58 @@
1-
import { createStore } from "vuex";
2-
3-
export default createStore({
4-
state: {
5-
hideConfigButton: false,
6-
isPinned: true,
7-
showConfig: false,
8-
isTransparent: "",
9-
isRTL: false,
10-
mcolor: "",
11-
isNavFixed: false,
12-
isAbsolute: false,
13-
showNavs: true,
14-
showSidenav: true,
15-
showNavbar: true,
16-
showFooter: true,
17-
showMain: true,
18-
},
19-
mutations: {
20-
toggleConfigurator(state) {
21-
state.showConfig = !state.showConfig;
22-
},
23-
navbarMinimize(state) {
24-
const sidenav_show = document.querySelector(".g-sidenav-show");
25-
26-
if (sidenav_show.classList.contains("g-sidenav-hidden")) {
27-
sidenav_show.classList.remove("g-sidenav-hidden");
28-
sidenav_show.classList.add("g-sidenav-pinned");
29-
state.isPinned = true;
30-
} else {
31-
sidenav_show.classList.add("g-sidenav-hidden");
32-
sidenav_show.classList.remove("g-sidenav-pinned");
33-
state.isPinned = false;
34-
}
35-
},
36-
sidebarType(state, payload) {
37-
state.isTransparent = payload;
38-
},
39-
navbarFixed(state) {
40-
if (state.isNavFixed === false) {
41-
state.isNavFixed = true;
42-
} else {
43-
state.isNavFixed = false;
44-
}
45-
},
46-
},
47-
actions: {
48-
toggleSidebarColor({ commit }, payload) {
49-
commit("sidebarType", payload);
50-
},
51-
},
52-
getters: {},
53-
});
1+
import { createStore } from "vuex";
2+
3+
export default createStore({
4+
state: {
5+
hideConfigButton: false,
6+
isPinned: true,
7+
showConfig: false,
8+
isTransparent: "",
9+
isRTL: false,
10+
mcolor: "",
11+
isNavFixed: false,
12+
isAbsolute: false,
13+
showNavs: true,
14+
showSidenav: true,
15+
showNavbar: true,
16+
showFooter: true,
17+
showMain: true,
18+
},
19+
mutations: {
20+
toggleConfigurator(state) {
21+
state.showConfig = !state.showConfig;
22+
},
23+
navbarMinimize(state) {
24+
const sidenav_show = document.querySelector(".g-sidenav-show");
25+
const sidenav = document.getElementById("sidenav-main");
26+
27+
if (sidenav_show.classList.contains("g-sidenav-pinned")) {
28+
sidenav_show.classList.remove("g-sidenav-pinned");
29+
setTimeout(function () {
30+
sidenav.classList.remove("bg-white");
31+
}, 100);
32+
sidenav.classList.remove("bg-transparent");
33+
state.isPinned = true;
34+
} else {
35+
sidenav_show.classList.add("g-sidenav-pinned");
36+
sidenav.classList.add("bg-white");
37+
sidenav.classList.remove("bg-transparent");
38+
state.isPinned = false;
39+
}
40+
},
41+
sidebarType(state, payload) {
42+
state.isTransparent = payload;
43+
},
44+
navbarFixed(state) {
45+
if (state.isNavFixed === false) {
46+
state.isNavFixed = true;
47+
} else {
48+
state.isNavFixed = false;
49+
}
50+
},
51+
},
52+
actions: {
53+
toggleSidebarColor({ commit }, payload) {
54+
commit("sidebarType", payload);
55+
},
56+
},
57+
getters: {},
58+
});

0 commit comments

Comments
 (0)