This commit is contained in:
2024-03-30 13:24:39 +01:00
parent c8f53c2f06
commit d05579c5ee
13 changed files with 113 additions and 125 deletions
+2 -4
View File
@@ -1,12 +1,10 @@
import { defineComponent } from 'vue';
import { useMainStore } from '../store/mainStore';
import { usePopupStore } from '../store/popupStore';
export default defineComponent({
data() {
return {
store: useMainStore(),
popupStore: usePopupStore()
store: useMainStore()
};
},
@@ -25,7 +23,7 @@ export default defineComponent({
closeModal() {
this.store.chosenModalTrainId = undefined;
this.popupStore.currentPopupComponent = null;
this.store.popUpData.key = null;
setTimeout(() => {
(this.store.modalLastClickedTarget as any)?.focus();
+27
View File
@@ -0,0 +1,27 @@
import { defineComponent } from 'vue';
import { useMainStore } from '../store/mainStore';
import { PopUpType, popupKeys } from '../store/typings';
const isPopUp = (v: any): v is PopUpType => popupKeys.includes(v);
export default defineComponent({
data() {
return {
store: useMainStore()
};
},
methods: {
showPopUp(e: MouseEvent, componentKey: string, value?: string) {
if (!isPopUp(componentKey)) return;
this.store.popUpData['key'] = componentKey;
this.store.popUpData['content'] = value ?? '';
},
hidePopUp() {
this.store.popUpData['key'] = null;
this.store.popUpData['content'] = '';
}
}
});