This commit is contained in:
2021-10-04 21:04:32 +00:00
parent 3984082b2b
commit 94ac95c746

View File

@@ -539,7 +539,6 @@ export default {
} }
}, },
async endDragExtend() { async endDragExtend() {
console.log("endDragExtend fired");
//On drag then dragged is set to true and dragEvent and dragTime are set //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 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 //on create then dragged is set to false and createStart is only value set, dragEvent is null and extendEvent is null
@@ -625,13 +624,13 @@ export default {
}, },
startDrag({ event }) { startDrag({ event }) {
//# mouse down on an event triggers this call //# mouse down on an event triggers this call
console.log("StartDrag, event:", JSON.stringify(event)); //console.log("StartDrag, event:", JSON.stringify(event));
if (event) { if (event) {
if (event.editable) { if (event.editable) {
this.lastMouseDownMS = new Date().getTime(); this.lastMouseDownMS = new Date().getTime();
//My work around to disambiguate dragging and clicking //My work around to disambiguate dragging and clicking
//clearTimeout(this.dragTimeout); //clearTimeout(this.dragTimeout);
console.log("startDrag in editable set dragged false"); // console.log("startDrag in editable set dragged false");
this.dragged = false; this.dragged = false;
// this.dragTimeout = setTimeout(() => { // this.dragTimeout = setTimeout(() => {
// this.dragged = true; // this.dragged = true;
@@ -652,7 +651,15 @@ export default {
itWasAClickNotADrag() { itWasAClickNotADrag() {
if (this.lastMouseDownMS == null) { if (this.lastMouseDownMS == null) {
//return; //return;
throw new Error("lastMouseMS is null!"); if (this.$ay.dev) {
throw new Error("lastMouseDownMS is null!");
} else {
window.$gz.store.commit(
"logItem",
"home-schedule:lastMouseDownMS is unexpectedly null"
);
return true; //least dangerous option in production
}
} }
const elapsed = new Date().getTime() - this.lastMouseDownMS; const elapsed = new Date().getTime() - this.lastMouseDownMS;
this.lastMouseDownMS = null; this.lastMouseDownMS = null;
@@ -805,12 +812,12 @@ export default {
}); });
}, },
async showMoreInfo(event) { async showMoreInfo(event) {
console.log("showMoreInfo click event fired"); console.log("showMoreInfo, event is", event);
//workaround to disambiguate drag click from view more info click //workaround to disambiguate drag click from view more info click
if (this.dragged) { // if (this.dragged) {
return; // return;
} // }
console.log("showMoreINfo not dragged, popping up"); // console.log("showMoreINfo not dragged, popping up");
let route = null; let route = null;
this.evInfo = {}; this.evInfo = {};
switch (event.type) { switch (event.type) {