annotate client/src/application/stores/application.js @ 622:47f11401d999

feat: Usermenu is now collapsible
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 11 Sep 2018 14:14:43 +0200
parents c4a4dc612191
children 620a65f11b33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 const defaultCollapseState = true;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 const Application = {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 namespaced: true,
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 state: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 appTitle: process.env.VUE_APP_TITLE,
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL,
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 sidebar: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 iscollapsed: defaultCollapseState
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 },
593
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
11 splitsceen: {
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
12 active: false,
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
13 mode: "v"
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
14 },
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
15 usermenu: {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
16 iscollapsed: defaultCollapseState
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
17 },
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 countries: ["AT", "SK", "HU", "HR", "RS", "BiH", "BG", "RO", "UA"]
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 getters: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 countries: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 return state.countries;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 sidebarCollapsed: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 return state.sidebar.iscollapsed;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 },
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
27 isUsermenuCollapsed: state => {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
28 return state.usermenu.iscollapsed;
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
29 },
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30 appTitle: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 return state.appTitle;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 secondaryLogo: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 return state.secondaryLogo;
593
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
35 },
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
36 isSplitscreen: state => {
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
37 return state.splitsceen.active;
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
38 },
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
39 splitMode: state => {
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
40 return state.splitsceen.mode;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
41 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
42 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
43 mutations: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
44 toggleSidebar: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
45 state.sidebar.iscollapsed = !state.sidebar.iscollapsed;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
46 },
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
47 toggleUserMenu: state => {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
48 state.usermenu.iscollapsed = !state.usermenu.iscollapsed;
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
49 },
593
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
50 toggleSplitScreen: state => {
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
51 state.splitsceen.active = !state.splitsceen.active;
c4a4dc612191 feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents: 585
diff changeset
52 },
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
53 resetSidebar: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
54 state.sidebar.iscollapsed = defaultCollapseState;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
55 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
56 collapseSidebar: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 state.sidebar.iscollapsed = true;
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
58 },
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
59 resetUserMenu: state => {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
60 state.usermenu.iscollapsed = defaultCollapseState;
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
61 },
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
62 collapseUserMenu: state => {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
63 state.usermenu.iscollapsed = true;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
64 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
65 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
66 actions: {}
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
67 };
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
68
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
69 export default Application;