Optimise seat chooser

This commit is contained in:
2023-07-07 21:11:49 +02:00
parent 2e0c9c49b5
commit 775a91351a
2 changed files with 12 additions and 15 deletions

View File

@@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vite",
"preview": "vite preview",
"serve": "vite --host",
"preview": "vite preview --host",
"build": "vite build"
},
"dependencies": {

View File

@@ -117,7 +117,7 @@
this.loadSeatplan();
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
// TODO: remove scaleDown function again once backend is up
// TODO: Optimise for odd screen sizes and aspect ratios
// TODO: Optimise for odd screen sizes and aspect ratios and fucking webkit
},
eventHandler ( e ) {
if ( this.prevSize.h != window.innerHeight || this.prevSize.w != window.innerWidth ) {
@@ -191,20 +191,17 @@
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
}
for ( let element in this.draggables ) {
if ( this.draggables[ element ].active ) {
this.draggables[ element ].active = false;
}
}
// Check if all seats are available
// TODO: delay call
let allSeatsAvailable = false;
// TODO: Check if all seats are available
let allSeatsAvailable = true;
// Method: Server sends all user selected seats + all selected seats. If seat is in both
// then selected, if just in all selected, taken, else available.
let self = this;
setTimeout( () => {
if ( !allSeatsAvailable ) {
setTimeout( () => {
self.$refs.popups.openPopup( 'We are sorry to tell you that since the last time the seat plan was refreshed, one or more of the seats you have selected has/have been taken.', {}, 'string' );
}
}, 500 );
}
},
scaleUp ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ];