@syncfusion/ej2-gantt 24.2.4 → 24.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5684,21 +5684,39 @@ class GanttChart {
5684
5684
  const mouseUp = Browser.touchEndEvent;
5685
5685
  const mouseMove = Browser.touchMoveEvent;
5686
5686
  const cancel = isIE11Pointer ? 'pointerleave' : 'mouseleave';
5687
- EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody, mouseDown, this.ganttChartMouseDown);
5688
- EventHandler.remove(this.parent.chartPane, cancel, this.ganttChartLeave);
5689
- EventHandler.remove(this.parent.chartPane, mouseMove, this.ganttChartMove);
5687
+ if (!isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody)) {
5688
+ EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody, mouseDown, this.ganttChartMouseDown);
5689
+ }
5690
+ if (!isNullOrUndefined(this.parent.chartPane)) {
5691
+ EventHandler.remove(this.parent.chartPane, cancel, this.ganttChartLeave);
5692
+ EventHandler.remove(this.parent.chartPane, mouseMove, this.ganttChartMove);
5693
+ }
5690
5694
  if (this.parent.isAdaptive) {
5691
- EventHandler.remove(this.parent.chartPane, click, this.ganttChartMouseClick);
5692
- EventHandler.remove(this.parent.chartPane, mouseUp, this.ganttChartMouseUp);
5695
+ if (!isNullOrUndefined(this.parent.chartPane)) {
5696
+ EventHandler.remove(this.parent.chartPane, click, this.ganttChartMouseClick);
5697
+ EventHandler.remove(this.parent.chartPane, mouseUp, this.ganttChartMouseUp);
5698
+ }
5693
5699
  }
5694
5700
  if (!this.parent.isAdaptive) {
5695
- EventHandler.remove(this.parent.element, mouseUp, this.documentMouseUp);
5696
- EventHandler.remove(document, mouseUp, this.mouseUp);
5701
+ if (!isNullOrUndefined(this.parent.element)) {
5702
+ EventHandler.remove(this.parent.element, mouseUp, this.documentMouseUp);
5703
+ }
5704
+ if (!isNullOrUndefined(document)) {
5705
+ EventHandler.remove(document, mouseUp, this.mouseUp);
5706
+ }
5707
+ }
5708
+ if (!isNullOrUndefined(this.parent.element)) {
5709
+ EventHandler.remove(this.parent.element, 'mousemove', this.mouseMoveHandler);
5710
+ }
5711
+ if (!isNullOrUndefined(document)) {
5712
+ EventHandler.remove(document, 'mouseup', this.contextClick);
5713
+ if (!isNullOrUndefined(document.body)) {
5714
+ EventHandler.remove(document.body, 'contextmenu', this.contextClick);
5715
+ }
5716
+ }
5717
+ if (!isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody)) {
5718
+ EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody, 'dblclick', this.doubleClickHandler);
5697
5719
  }
5698
- EventHandler.remove(this.parent.element, 'mousemove', this.mouseMoveHandler);
5699
- EventHandler.remove(document.body, 'contextmenu', this.contextClick);
5700
- EventHandler.remove(document, 'mouseup', this.contextClick);
5701
- EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody, 'dblclick', this.doubleClickHandler);
5702
5720
  }
5703
5721
  /**
5704
5722
  * To get record by taskbar element.
@@ -6187,8 +6205,10 @@ class GanttChart {
6187
6205
  destroy() {
6188
6206
  this.removeEventListener();
6189
6207
  this.unWireEvents();
6190
- this.scrollObject.destroy();
6191
- this.scrollObject = null;
6208
+ if (!isNullOrUndefined(this.scrollObject)) {
6209
+ this.scrollObject.destroy();
6210
+ this.scrollObject = null;
6211
+ }
6192
6212
  }
6193
6213
  }
6194
6214
 
@@ -6276,6 +6296,8 @@ class Timeline {
6276
6296
  */
6277
6297
  updateChartByNewTimeline() {
6278
6298
  this.parent.chartRowsModule.refreshChartByTimeline();
6299
+ let currentScrollLeft = this.parent.element.getElementsByClassName('e-chart-scroll-container e-content')[0].scrollLeft;
6300
+ this.parent.element.getElementsByClassName('e-timeline-header-container')[0].scrollLeft = currentScrollLeft;
6279
6301
  this.parent.notify('refreshDayMarkers', {});
6280
6302
  }
6281
6303
  /**
@@ -24026,7 +24048,7 @@ class DialogEdit {
24026
24048
  renderInputElements(inputModel, column) {
24027
24049
  const ganttId = this.parent.element.id;
24028
24050
  const ganttData = this.editedRecord;
24029
- const divElement = this.createFormElement('e-edit-form-column');
24051
+ const divElement = this.createDivElement('e-edit-form-column');
24030
24052
  let inputElement;
24031
24053
  const editArgs = { column: column, data: ganttData };
24032
24054
  if (!isNullOrUndefined(column.edit) && isNullOrUndefined(column.edit.params)) {
@@ -25155,10 +25177,33 @@ class ConnectorLineEdit {
25155
25177
  this.parent.editModule.updateEditedTask(args.editEventArgs);
25156
25178
  }
25157
25179
  else if (args.validateMode.preserveLinkWithEditing) {
25180
+ let connectedTaskId;
25158
25181
  if (this.parent.UpdateOffsetOnTaskbarEdit) {
25159
25182
  this.calculateOffset(ganttRecord);
25183
+ let taskId = ganttRecord.ganttProperties.taskId;
25184
+ ganttRecord.ganttProperties.predecessor.forEach(predecessor => {
25185
+ if (taskId == predecessor.from) {
25186
+ connectedTaskId = predecessor.to;
25187
+ return;
25188
+ }
25189
+ });
25160
25190
  }
25161
25191
  this.parent.editModule.updateEditedTask(args.editEventArgs);
25192
+ this.processPredecessors(connectedTaskId);
25193
+ }
25194
+ }
25195
+ processPredecessors(parentId) {
25196
+ if (parentId) {
25197
+ const record = this.parent.getRecordByID(parentId);
25198
+ this.calculateOffset(record);
25199
+ if (record && record.ganttProperties && record.ganttProperties.predecessor) {
25200
+ const predecessors = record.ganttProperties.predecessor;
25201
+ predecessors.forEach(predecessor => {
25202
+ if (record.ganttProperties.taskId == predecessor.from) {
25203
+ this.processPredecessors(predecessor.to);
25204
+ }
25205
+ });
25206
+ }
25162
25207
  }
25163
25208
  }
25164
25209
  checkChildRecords(ganttRecord) {