This commit is contained in:
@@ -405,6 +405,7 @@ TODO NEXT:
|
||||
|
||||
// const FORM_CUSTOM_TEMPLATE_KEY = "home-schedule";
|
||||
const FORM_KEY = "home-schedule";
|
||||
const CLICK_DETECT_TIMEOUT = 200;
|
||||
export default {
|
||||
async created() {
|
||||
let vm = this;
|
||||
@@ -526,7 +527,7 @@ export default {
|
||||
this.dragged = false;
|
||||
this.dragTimeout = setTimeout(() => {
|
||||
this.dragged = true;
|
||||
}, 200); // Min delay to be regarded as extend instead of click, also affects click time to display more info, too short needs faster click
|
||||
}, CLICK_DETECT_TIMEOUT); // Min delay to be regarded as extend instead of click, also affects click time to display more info, too short needs faster click
|
||||
|
||||
this.dragEvent = event;
|
||||
this.dragTime = null;
|
||||
@@ -543,7 +544,7 @@ export default {
|
||||
this.dragged = false;
|
||||
this.dragTimeout = setTimeout(() => {
|
||||
this.dragged = true;
|
||||
}, 200); // Min delay to be regarded as extend instead of click, also affects click time to display more info, too short needs faster click
|
||||
}, CLICK_DETECT_TIMEOUT); // Min delay to be regarded as extend instead of click, also affects click time to display more info, too short needs faster click
|
||||
|
||||
//this.dragEvent = event;
|
||||
this.extendEvent = event;
|
||||
@@ -552,22 +553,28 @@ export default {
|
||||
}
|
||||
},
|
||||
async endDragExtend() {
|
||||
//On drag then dragEvent and dragTime are set
|
||||
//on extend then extendEvent (actual event), extendOriginal and createStart are set, dragEvent is null
|
||||
//on create then createStart is only value set, dragEvent is null and extendEvent is null
|
||||
//On drag then dragged is set to true and dragEvent and dragTime are set
|
||||
//on extend then dragged is set to true extendEvent (actual event), extendOriginal and createStart are set, dragEvent is null
|
||||
//on create then dragged is set to false and createStart is only value set, dragEvent is null and extendEvent is null
|
||||
|
||||
//Handle the event, could be one of three things: changing an event start time, changing an event length or creating a new event
|
||||
|
||||
if (this.extendEvent && this.extendEvent.type == 0) {
|
||||
//NEW, prompt for deets and create or if cancelled then just remove this faux event from events list (it will be the last one in the array)
|
||||
//Open create dialog here
|
||||
this.newItemDialog = true;
|
||||
} else {
|
||||
//New or modify existing
|
||||
if (!this.dragged) {
|
||||
//we're here due to mouse up but it's not a drag or an extend so it's a More Info mouse up click so bail out now
|
||||
return;
|
||||
}
|
||||
|
||||
//MODIFY existing event, drag or extend
|
||||
if (this.dragEvent || this.extendEvent) {
|
||||
let param = { type: null, id: null, start: null, end: null };
|
||||
|
||||
if (this.dragEvent) {
|
||||
// && this.dragged
|
||||
|
||||
param.type = this.dragEvent.type;
|
||||
param.id = this.dragEvent.id;
|
||||
param.start = window.$gz.locale.localScheduleFormatToUTC8601String(
|
||||
|
||||
Reference in New Issue
Block a user