From 252dd6fc6f53ecd8b28e05a0514429472d53d08e Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 06:46:31 +0100 Subject: viewer: finalized the command buttons. added the 'up to parent' command --- viewer/src/store/uiStore.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'viewer/src/store') 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({ export default class UIStore extends VuexModule { fullscreen: boolean = false; + fullWidth: boolean = true; mode: "navigation" | "search" = "navigation"; currentTags: Tag.Search[] = []; @@ -46,6 +47,10 @@ export default class UIStore extends VuexModule { this.fullscreen = !this.fullscreen; } + @mutation toggleFullWidth() { + this.fullWidth = !this.fullWidth; + } + @mutation setModeNavigation() { this.mode = "navigation"; } -- cgit v1.2.3 From 1e0b65a0a4556810ad4a7acac764a57a7daf8cf0 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 07:10:34 +0100 Subject: viewer: minor code cleaning --- viewer/src/store/galleryStore.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'viewer/src/store') 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 { } get currentItemPath(): Gallery.Item[] { - const galleryItemsRoot = this.galleryItemsRoot; - if (galleryItemsRoot) - return GalleryStore.searchCurrentItemPath(galleryItemsRoot, this.currentPath); + const root = this.galleryItemsRoot; + if (root) + return GalleryStore.searchCurrentItemPath(root, this.currentPath); return []; } get currentItem(): Gallery.Item | null { - const currentItemPath = this.currentItemPath; - return currentItemPath.length > 0 ? currentItemPath[currentItemPath.length - 1] : null; + const path = this.currentItemPath; + return path.length > 0 ? path[path.length - 1] : null; } // --- @@ -69,9 +69,9 @@ export default class GalleryStore extends VuexModule { // Indexes the gallery @action async indexTags() { + const root = this.galleryItemsRoot; let index = {}; - if (this.galleryItemsRoot) - GalleryStore.pushTagsForItem(index, this.galleryItemsRoot); + if (root) GalleryStore.pushTagsForItem(index, root); console.log("Index: ", index); this.setTags(index); } -- cgit v1.2.3