|
|
@@ -179,7 +179,7 @@ export default defineComponent({
|
|
|
...payload.toJSON(),
|
|
|
event: new jcEvent({ ...payload.event, id: uuidv4() }),
|
|
|
});
|
|
|
- newCreneau.title = "Copie de " + newCreneau.title;
|
|
|
+ // newCreneau.title = "Copie de " + newCreneau.title;
|
|
|
this.timeline.addEvent(newCreneau.event);
|
|
|
this.commit(MutationTypes.addCreneau, newCreneau);
|
|
|
this.currentCreneau = newCreneau;
|
|
|
@@ -304,6 +304,25 @@ export default defineComponent({
|
|
|
this.menuY = e.clientY;
|
|
|
(this.$refs.menu as typeof ContextMenu).open();
|
|
|
},
|
|
|
+ dblclick(e: MouseEvent) {
|
|
|
+ if (this.timeline) {
|
|
|
+ const node = this.timeline.shadowRoot?.elementFromPoint(e.clientX, e.clientY);
|
|
|
+ if (node) {
|
|
|
+ if (node.className.startsWith("jc-timeslot-") || node.classList.contains("jc-timeslot")) {
|
|
|
+ const timeslot = node.classList.contains("jc-timeslot") ? node : node.parentElement;
|
|
|
+ const creneau = this.$store.getters.getCreneauById(
|
|
|
+ timeslot?.getAttribute("eventid") ?? ""
|
|
|
+ );
|
|
|
+ if (creneau) {
|
|
|
+ this.currentCreneau = creneau;
|
|
|
+ setTimeout(() => {
|
|
|
+ (document.getElementById("last_name") as HTMLInputElement | undefined)?.select();
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
rightclick(e: MouseEvent) {
|
|
|
if (this.timeline) {
|
|
|
const node = this.timeline.shadowRoot?.elementFromPoint(e.clientX, e.clientY);
|
|
|
@@ -393,7 +412,7 @@ export default defineComponent({
|
|
|
mounted() {
|
|
|
this.timeline.setAttribute("start", this.start.toISOString());
|
|
|
this.timeline.setAttribute("end", this.end.toISOString());
|
|
|
- this.timeline.addRessources(this.creneauGroupList);
|
|
|
+ this.timeline.addRessources(this.creneauGroupList, 0);
|
|
|
this.$store.commit(
|
|
|
MutationTypes.reorderCreneauGroup,
|
|
|
this.timeline.getRessources().map((o) => o.id)
|
|
|
@@ -430,6 +449,8 @@ export default defineComponent({
|
|
|
}`;
|
|
|
this.timeline.clearSelectedItems();
|
|
|
this.timeline.addEventListener("contextmenu", this.rightclick);
|
|
|
+
|
|
|
+ this.timeline.addEventListener("dblclick", this.dblclick);
|
|
|
},
|
|
|
});
|
|
|
</script>
|