|
|
@@ -30,7 +30,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
|
|
|
this.slotWidth = 20;
|
|
|
this.legendUnitFormat = { "y": "YYYY", "M": "MMMM", "d": 'D', "h": "H[h]", "m": "m'", 's': "s[s]" };
|
|
|
this._clearSelectionHandler = (_e) => {
|
|
|
- this._clearSelectedItems();
|
|
|
+ this.clearSelectedItems();
|
|
|
window.removeEventListener("click", this._clearSelectionHandler);
|
|
|
};
|
|
|
this.rows = [];
|
|
|
@@ -127,7 +127,6 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
|
|
|
this.rows = [...this.rows, r];
|
|
|
}
|
|
|
this.addRessources(r.children);
|
|
|
- this._clearSelectedItems();
|
|
|
this._updateEventPosition(r);
|
|
|
return r;
|
|
|
}
|
|
|
@@ -207,7 +206,6 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
|
|
|
this.items = [...this.items, timeslot];
|
|
|
timeslot.isDisplayed = timeslot.end > this._start.toDate() || timeslot.start < this._end.toDate();
|
|
|
this._updateEventPosition(ressource);
|
|
|
- this._clearSelectedItems();
|
|
|
return timeslot;
|
|
|
}
|
|
|
removeEventById(id) {
|
|
|
@@ -435,7 +433,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
|
|
|
window.addEventListener("mouseup", mouseUpListener);
|
|
|
};
|
|
|
}
|
|
|
- _clearSelectedItems() {
|
|
|
+ clearSelectedItems() {
|
|
|
this.items.forEach((selectable) => {
|
|
|
selectable.selected = false;
|
|
|
this.updateEventById(selectable.id);
|
|
|
@@ -456,13 +454,13 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
|
|
|
this.updateEventById(item.id);
|
|
|
}
|
|
|
else {
|
|
|
- this._clearSelectedItems();
|
|
|
+ this.clearSelectedItems();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
if (this.selectedList.length > 0 && !e.ctrlKey) {
|
|
|
- this._clearSelectedItems();
|
|
|
+ this.clearSelectedItems();
|
|
|
}
|
|
|
item.selected = true;
|
|
|
this.selectedList.push(item);
|