mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
dodano dymki kontekstowe oraz podgląd pojazdu
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export const usePopupStore = defineStore('popupStore', {
|
||||
state: () => ({
|
||||
popupPosition: { x: 0, y: 0 },
|
||||
currentPopupComponent: null as
|
||||
| null
|
||||
| 'DonatorPopUp'
|
||||
| 'TrainCommentsPopUp'
|
||||
| 'VehiclePreviewPopUp',
|
||||
currentPopupContent: '',
|
||||
donatorPopupVisible: false
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onPopUpShow(e: MouseEvent, componentKey: typeof this.currentPopupComponent, value?: string) {
|
||||
this.popupPosition.x = e.pageX;
|
||||
this.popupPosition.y = e.pageY;
|
||||
|
||||
this.currentPopupComponent = componentKey;
|
||||
this.currentPopupContent = value ?? '';
|
||||
},
|
||||
|
||||
onPopUpMove(e: MouseEvent) {
|
||||
this.popupPosition.x = e.pageX;
|
||||
this.popupPosition.y = e.pageY;
|
||||
},
|
||||
|
||||
onPopUpHide() {
|
||||
this.currentPopupComponent = null;
|
||||
this.currentPopupContent = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -11,20 +11,14 @@ export interface RegionCounters {
|
||||
|
||||
export interface StoreState {
|
||||
region: { id: string; value: string };
|
||||
|
||||
isOffline: boolean;
|
||||
|
||||
isNewUpdate: boolean;
|
||||
|
||||
dispatcherStatsName: string;
|
||||
dispatcherStatsData?: API.DispatcherStats.Response;
|
||||
|
||||
driverStatsName: string;
|
||||
driverStatsData?: API.DriverStats.Response;
|
||||
driverStatsStatus: Status.Data;
|
||||
|
||||
chosenModalTrainId?: string;
|
||||
|
||||
blockScroll: boolean;
|
||||
modalLastClickedTarget: EventTarget | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user