diff options
author | pacien | 2020-05-02 04:11:24 +0200 |
---|---|---|
committer | pacien | 2020-05-02 04:11:24 +0200 |
commit | 8e3ac8fe44bebb38e1882ca7f06b8100078ad88d (patch) | |
tree | a748fa1e639cb3b5e1f24a8150e89dbb28c980cb /viewer/src/store/uiStore.ts | |
parent | 7042ffc06326fa8ffe70f5a59747709250166c16 (diff) | |
parent | 0e0b5b0ae44da7c1d67983dedd8f8d8d3516236f (diff) | |
download | ldgallery-8e3ac8fe44bebb38e1882ca7f06b8100078ad88d.tar.gz |
Merge branch 'develop': release v1.0v1.0
Diffstat (limited to 'viewer/src/store/uiStore.ts')
-rw-r--r-- | viewer/src/store/uiStore.ts | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/viewer/src/store/uiStore.ts b/viewer/src/store/uiStore.ts index 6bcc538..892d35e 100644 --- a/viewer/src/store/uiStore.ts +++ b/viewer/src/store/uiStore.ts | |||
@@ -20,37 +20,27 @@ | |||
20 | import { createModule, mutation, action } from "vuex-class-component"; | 20 | import { createModule, mutation, action } from "vuex-class-component"; |
21 | 21 | ||
22 | const VuexModule = createModule({ | 22 | const VuexModule = createModule({ |
23 | namespaced: "uiStore", | 23 | namespaced: "uiStore", |
24 | strict: false | 24 | strict: true |
25 | }) | 25 | }) |
26 | 26 | ||
27 | export default class UIStore extends VuexModule { | 27 | export default class UIStore extends VuexModule { |
28 | 28 | ||
29 | fullscreen: boolean = false; | 29 | fullscreen: boolean = false; |
30 | mode: "navigation" | "search" = "navigation"; | 30 | fullWidth: boolean = window.innerWidth < Number(process.env.VUE_APP_FULLWIDTH_LIMIT); |
31 | currentTags: Tag.Search[] = []; | 31 | searchMode: boolean = false; |
32 | 32 | ||
33 | // --- | 33 | // --- |
34 | 34 | ||
35 | get isModeSearch() { | 35 | @mutation toggleFullscreen(value?: boolean) { |
36 | return this.mode === "search"; | 36 | this.fullscreen = value ?? !this.fullscreen; |
37 | } | 37 | } |
38 | 38 | ||
39 | get isModeNavigation() { | 39 | @mutation toggleFullWidth(value?: boolean) { |
40 | return this.mode === "navigation"; | 40 | this.fullWidth = value ?? !this.fullWidth; |
41 | } | 41 | } |
42 | 42 | ||
43 | // --- | 43 | @mutation toggleSearchMode(value?: boolean) { |
44 | 44 | this.searchMode = value ?? !this.searchMode; | |
45 | @mutation toggleFullscreen() { | 45 | } |
46 | this.fullscreen = !this.fullscreen; | ||
47 | } | ||
48 | |||
49 | @mutation setModeNavigation() { | ||
50 | this.mode = "navigation"; | ||
51 | } | ||
52 | |||
53 | @mutation setModeSearch() { | ||
54 | this.mode = "search"; | ||
55 | } | ||
56 | } | 46 | } |