mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
Optimise seat chooser
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vite",
|
"serve": "vite --host",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview --host",
|
||||||
"build": "vite build"
|
"build": "vite build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
this.loadSeatplan();
|
this.loadSeatplan();
|
||||||
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
|
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
|
||||||
// TODO: remove scaleDown function again once backend is up
|
// 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 ) {
|
eventHandler ( e ) {
|
||||||
if ( this.prevSize.h != window.innerHeight || this.prevSize.w != window.innerWidth ) {
|
if ( this.prevSize.h != window.innerHeight || this.prevSize.w != window.innerWidth ) {
|
||||||
@@ -191,20 +191,17 @@
|
|||||||
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( let element in this.draggables ) {
|
// TODO: Check if all seats are available
|
||||||
if ( this.draggables[ element ].active ) {
|
let allSeatsAvailable = true;
|
||||||
this.draggables[ element ].active = false;
|
// 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.
|
||||||
}
|
|
||||||
// Check if all seats are available
|
|
||||||
// TODO: delay call
|
|
||||||
let allSeatsAvailable = false;
|
|
||||||
let self = this;
|
let self = this;
|
||||||
setTimeout( () => {
|
if ( !allSeatsAvailable ) {
|
||||||
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' );
|
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 );
|
||||||
}, 500 );
|
}
|
||||||
},
|
},
|
||||||
scaleUp ( valueArray ) {
|
scaleUp ( valueArray ) {
|
||||||
const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
|
const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
|
||||||
|
|||||||
Reference in New Issue
Block a user