This commit is contained in:
@@ -270,6 +270,7 @@ SETTINGS:
|
||||
drag/extend needs to actually update the work order
|
||||
drag/extend should not affect locked workorders!!
|
||||
Add canModify or something to event data so no need to even start the op if it can't be done
|
||||
Extension handle hard to see sb colored same as title text to contrast or have dark and light lines both maybe??
|
||||
|
||||
|
||||
Test: overlapping sched items that start or end outside of view
|
||||
@@ -321,7 +322,7 @@ export default {
|
||||
evInfo: {},
|
||||
dragEvent: null,
|
||||
dragStart: null,
|
||||
createEvent: null,
|
||||
extendEvent: null,
|
||||
createStart: null,
|
||||
extendOriginal: null,
|
||||
dragged: false,
|
||||
@@ -373,55 +374,58 @@ export default {
|
||||
}, 100); // Minimal delay to be regarded as extend instead of click
|
||||
|
||||
//this.dragEvent = event;
|
||||
this.createEvent = event;
|
||||
this.extendEvent = event;
|
||||
this.createStart = event.start;
|
||||
this.extendOriginal = event.end;
|
||||
},
|
||||
endDragExtend() {
|
||||
//On drag then dragEvent and dragTime are set
|
||||
//on extend then createEvent (actual event), extendOriginal and createStart are set
|
||||
//on create then createStart is only value set, dragEvent is null and createEvent is null
|
||||
//on extend then extendEvent (actual event), extendOriginal and createStart are set
|
||||
//on create then createStart is only value set, dragEvent is null and extendEvent is null
|
||||
|
||||
if (this.dragEvent) {
|
||||
console.log("endDragExtend: event is DRAG of existing event");
|
||||
console.log("endDragExtend: event is DRAG of existing event", {
|
||||
dragEventStart: this.dragEvent.start,
|
||||
dragTime: this.dragTime
|
||||
});
|
||||
}
|
||||
if (this.createEvent) {
|
||||
if (this.extendEvent) {
|
||||
console.log("endDragExtend: event is EXTEND of existing event");
|
||||
}
|
||||
if (this.createStart && !this.dragEvent && !this.createEvent) {
|
||||
if (this.createStart && !this.dragEvent && !this.extendEvent) {
|
||||
console.log("endDragExtend: event is CREATE for new event");
|
||||
}
|
||||
|
||||
// console.log("endDragExtend, deets: ", {
|
||||
// dragEvent: this.dragEvent,
|
||||
// dragTime: this.dragTime,
|
||||
// createEvent: this.createEvent,
|
||||
// extendEvent: this.extendEvent,
|
||||
// createStart: this.createStart,
|
||||
// extendOriginal: this.extendOriginal
|
||||
// });
|
||||
|
||||
this.dragTime = null;
|
||||
this.dragEvent = null;
|
||||
this.createEvent = null;
|
||||
this.extendEvent = null;
|
||||
this.createStart = null;
|
||||
this.extendOriginal = null;
|
||||
},
|
||||
cancelDrag() {
|
||||
// console.log("cancelDrag");
|
||||
if (this.createEvent) {
|
||||
if (this.extendEvent) {
|
||||
console.log("Cancel drag A path (cancel?)");
|
||||
if (this.extendOriginal) {
|
||||
this.createEvent.end = this.extendOriginal;
|
||||
this.extendEvent.end = this.extendOriginal;
|
||||
} else {
|
||||
console.log("Cancel drag B path (do it?)");
|
||||
const i = this.events.indexOf(this.createEvent);
|
||||
const i = this.events.indexOf(this.extendEvent);
|
||||
if (i !== -1) {
|
||||
this.events.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.createEvent = null;
|
||||
this.extendEvent = null;
|
||||
this.createStart = null;
|
||||
this.dragTime = null;
|
||||
this.dragEvent = null;
|
||||
@@ -454,7 +458,7 @@ export default {
|
||||
|
||||
this.dragEvent.start = newStart;
|
||||
this.dragEvent.end = newEnd;
|
||||
} else if (this.createEvent && this.createStart !== null) {
|
||||
} else if (this.extendEvent && this.createStart !== null) {
|
||||
//# EXTENDING PATH
|
||||
console.log("mosueMove: EXTENDING");
|
||||
const mouseRounded = this.roundTime(mouse, false);
|
||||
@@ -462,8 +466,8 @@ export default {
|
||||
const min = Math.min(mouseRounded, this.createStart);
|
||||
const max = Math.max(mouseRounded, this.createStart);
|
||||
|
||||
this.createEvent.start = min;
|
||||
this.createEvent.end = max;
|
||||
this.extendEvent.start = min;
|
||||
this.extendEvent.end = max;
|
||||
}
|
||||
},
|
||||
startTime(tms) {
|
||||
@@ -484,15 +488,15 @@ export default {
|
||||
"startTime::STUB Create new element, popup FAB speeddial here"
|
||||
);
|
||||
// //console.log("startTime, create start:", this.createStart);
|
||||
// this.createEvent = {
|
||||
// this.extendEvent = {
|
||||
// name: `Event #${this.events.length}`,
|
||||
// color: this.rndElement(this.colors),
|
||||
// start: this.createStart,
|
||||
// end: this.createStart,
|
||||
// timed: true
|
||||
// };
|
||||
// //console.log("startTime, pushing event:", this.createEvent);
|
||||
// this.events.push(this.createEvent);
|
||||
// //console.log("startTime, pushing event:", this.extendEvent);
|
||||
// this.events.push(this.extendEvent);
|
||||
}
|
||||
},
|
||||
roundTime(time, down = true) {
|
||||
@@ -879,11 +883,11 @@ async function fetchTranslatedText(vm) {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
height: 4px;
|
||||
border-top: 1px solid white;
|
||||
border-bottom: 1px solid white;
|
||||
width: 16px;
|
||||
border-top: 1px solid gray;
|
||||
border-bottom: 1px solid gray;
|
||||
width: 32px;
|
||||
margin-left: -8px;
|
||||
opacity: 0.8;
|
||||
// opacity: 0.8;
|
||||
content: "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user