mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
srjp: poprawki dostępności modalu
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { Ref, defineComponent } from 'vue';
|
||||
import { useStore } from '../store/store';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -15,15 +15,17 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
methods: {
|
||||
selectModalTrain(trainId: string) {
|
||||
selectModalTrain(trainId: string, target?: EventTarget | null) {
|
||||
this.store.chosenModalTrainId = trainId;
|
||||
document.body.classList.add('no-scroll');
|
||||
if (target) this.store.modalLastClickedTarget = target;
|
||||
},
|
||||
|
||||
closeModal() {
|
||||
this.store.chosenModalTrainId = undefined;
|
||||
|
||||
setTimeout(() => {
|
||||
(this.store.modalLastClickedTarget as any)?.focus();
|
||||
document.body.classList.remove('no-scroll');
|
||||
}, 150);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user