From 7585e247445e0d73d62d9fe3f7fda5ecf169a314 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 13 May 2021 17:10:36 +0100 Subject: [PATCH] Swap windows for tabs Each ImJoy window now gets its own top-level tab. This involved some fairly significant refactoring of the ImJoy component, but I think it's cleaner now. I've moved imjoy-related stuff into a store "module" to keep it clean. --- .../api/static/src/components/appContent.vue | 39 +++- .../galleryComponents/captureCard.vue | 13 +- .../galleryComponents/scanCard.vue | 9 +- .../imjoyComponents/imjoyPluginCard.vue | 48 +++++ .../tabContentComponents/imjoyContent.vue | 202 ++++++------------ .../api/static/src/store.js | 70 +++++- 6 files changed, 224 insertions(+), 157 deletions(-) create mode 100644 openflexure_microscope/api/static/src/components/tabContentComponents/imjoyComponents/imjoyPluginCard.vue diff --git a/openflexure_microscope/api/static/src/components/appContent.vue b/openflexure_microscope/api/static/src/components/appContent.vue index 538bb6d8..bc2cb1c7 100644 --- a/openflexure_microscope/api/static/src/components/appContent.vue +++ b/openflexure_microscope/api/static/src/components/appContent.vue @@ -60,6 +60,26 @@ src="https://imjoy.io/static/img/imjoy-icon.svg" /> + + + + + {{ imjoyTab.iconName || "extension" }} + + +
@@ -124,6 +144,16 @@ + +
Loading...
+
+ import axios from "axios"; +import { mapState } from "vuex"; // Import generic components import tabIcon from "./genericComponents/tabIcon"; @@ -264,7 +295,9 @@ export default { currentTabIndex: function() { return this.tabOrder.indexOf(this.currentTab); - } + }, + + ...mapState("imjoy", { imjoyTabs: "tabs" }) }, created: function() { @@ -370,6 +403,10 @@ export default {