aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/store
diff options
context:
space:
mode:
authorNotkea2020-01-31 18:09:33 +0100
committerGitHub2020-01-31 18:09:33 +0100
commit245fee3fe5abdc6ad14513ef6522446aba4c905a (patch)
tree749ec466c404499f19d571834262b87c14f0d0af /viewer/src/store
parentd94b987463169b254ab69a79ddb58e5beccb0941 (diff)
parentbe8ec3edaed843f08dac3d2bf2f10f7247ef3d3a (diff)
downloadldgallery-245fee3fe5abdc6ad14513ef6522446aba4c905a.tar.gz
Merge pull request #68 from pacien/oz-viewer
Diffstat (limited to 'viewer/src/store')
-rw-r--r--viewer/src/store/galleryStore.ts14
-rw-r--r--viewer/src/store/uiStore.ts5
2 files changed, 12 insertions, 7 deletions
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts
index b2ff74e..1c95fe7 100644
--- a/viewer/src/store/galleryStore.ts
+++ b/viewer/src/store/galleryStore.ts
@@ -46,15 +46,15 @@ export default class GalleryStore extends VuexModule {
46 } 46 }
47 47
48 get currentItemPath(): Gallery.Item[] { 48 get currentItemPath(): Gallery.Item[] {
49 const galleryItemsRoot = this.galleryItemsRoot; 49 const root = this.galleryItemsRoot;
50 if (galleryItemsRoot) 50 if (root)
51 return GalleryStore.searchCurrentItemPath(galleryItemsRoot, this.currentPath); 51 return GalleryStore.searchCurrentItemPath(root, this.currentPath);
52 return []; 52 return [];
53 } 53 }
54 54
55 get currentItem(): Gallery.Item | null { 55 get currentItem(): Gallery.Item | null {
56 const currentItemPath = this.currentItemPath; 56 const path = this.currentItemPath;
57 return currentItemPath.length > 0 ? currentItemPath[currentItemPath.length - 1] : null; 57 return path.length > 0 ? path[path.length - 1] : null;
58 } 58 }
59 59
60 // --- 60 // ---
@@ -69,9 +69,9 @@ export default class GalleryStore extends VuexModule {
69 69
70 // Indexes the gallery 70 // Indexes the gallery
71 @action async indexTags() { 71 @action async indexTags() {
72 const root = this.galleryItemsRoot;
72 let index = {}; 73 let index = {};
73 if (this.galleryItemsRoot) 74 if (root) GalleryStore.pushTagsForItem(index, root);
74 GalleryStore.pushTagsForItem(index, this.galleryItemsRoot);
75 console.log("Index: ", index); 75 console.log("Index: ", index);
76 this.setTags(index); 76 this.setTags(index);
77 } 77 }
diff --git a/viewer/src/store/uiStore.ts b/viewer/src/store/uiStore.ts
index 6bcc538..f7484de 100644
--- a/viewer/src/store/uiStore.ts
+++ b/viewer/src/store/uiStore.ts
@@ -27,6 +27,7 @@ const VuexModule = createModule({
27export default class UIStore extends VuexModule { 27export default class UIStore extends VuexModule {
28 28
29 fullscreen: boolean = false; 29 fullscreen: boolean = false;
30 fullWidth: boolean = true;
30 mode: "navigation" | "search" = "navigation"; 31 mode: "navigation" | "search" = "navigation";
31 currentTags: Tag.Search[] = []; 32 currentTags: Tag.Search[] = [];
32 33
@@ -46,6 +47,10 @@ export default class UIStore extends VuexModule {
46 this.fullscreen = !this.fullscreen; 47 this.fullscreen = !this.fullscreen;
47 } 48 }
48 49
50 @mutation toggleFullWidth() {
51 this.fullWidth = !this.fullWidth;
52 }
53
49 @mutation setModeNavigation() { 54 @mutation setModeNavigation() {
50 this.mode = "navigation"; 55 this.mode = "navigation";
51 } 56 }