Loading openflexure_microscope/api/static/src/components/appContent.vue +28 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,18 @@ export default { } } return pluginGuis; }, tabOrder: function() { // TODO: There must be a better way to do this, somehow reading the order of the HTML elements? var ind = ["view", "gallery", "navigate", "capture", "settings"]; for (const plugin of this.pluginsGuiList) { ind.push(plugin.id); } ind.push("about"); return ind; }, currentTabIndex: function() { return this.tabOrder.indexOf(this.currentTab); } }, Loading Loading @@ -246,6 +258,14 @@ export default { this.$root.$on("globalSwitchTab", tabID => { this.currentTab = tabID; }); // A global signal listener to increment tab this.$root.$on("globalIncrementTab", () => { this.incrementTabBy(1); }); // A global signal listener to decrement tab this.$root.$on("globalDecrementTab", () => { this.incrementTabBy(-1); }); }, beforeDestroy() { Loading Loading @@ -274,6 +294,14 @@ export default { this.currentTab = tab; } }, incrementTabBy: function(n) { const newIndex = (((this.currentTabIndex + n) % this.tabOrder.length) + this.tabOrder.length) % this.tabOrder.length; const newId = this.tabOrder[newIndex]; this.currentTab = newId; }, startModals: function() { this.$refs["calibrationModal"].show(); }, Loading Loading
openflexure_microscope/api/static/src/components/appContent.vue +28 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,18 @@ export default { } } return pluginGuis; }, tabOrder: function() { // TODO: There must be a better way to do this, somehow reading the order of the HTML elements? var ind = ["view", "gallery", "navigate", "capture", "settings"]; for (const plugin of this.pluginsGuiList) { ind.push(plugin.id); } ind.push("about"); return ind; }, currentTabIndex: function() { return this.tabOrder.indexOf(this.currentTab); } }, Loading Loading @@ -246,6 +258,14 @@ export default { this.$root.$on("globalSwitchTab", tabID => { this.currentTab = tabID; }); // A global signal listener to increment tab this.$root.$on("globalIncrementTab", () => { this.incrementTabBy(1); }); // A global signal listener to decrement tab this.$root.$on("globalDecrementTab", () => { this.incrementTabBy(-1); }); }, beforeDestroy() { Loading Loading @@ -274,6 +294,14 @@ export default { this.currentTab = tab; } }, incrementTabBy: function(n) { const newIndex = (((this.currentTabIndex + n) % this.tabOrder.length) + this.tabOrder.length) % this.tabOrder.length; const newId = this.tabOrder[newIndex]; this.currentTab = newId; }, startModals: function() { this.$refs["calibrationModal"].show(); }, Loading