1
1
/** @license
2
2
3
- dhtmlxGantt v.9.0.2 Standard
3
+ dhtmlxGantt v.9.0.3 Standard
4
4
5
5
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
6
6
@@ -3555,7 +3555,7 @@ class QuickInfo {
3555
3555
for (let i = 0; i < buttons.length; i++) {
3556
3556
const ariaAttr = gantt3._waiAria.quickInfoButtonAttrString(gantt3.locale.labels[buttons[i]]);
3557
3557
html += `<div class="gantt_qi_big_icon ${buttons[i]} dhx_gantt_${buttons[i]}" title="${gantt3.locale.labels[buttons[i]]}" ${ariaAttr}>
3558
- <div class='dhx_menu_icon ${buttons[i]} gantt_menu_icon dhx_gantt_${buttons[i]}'></div>
3558
+ <div class='dhx_menu_icon dhx_gantt_icon ${buttons[i]} gantt_menu_icon dhx_gantt_${buttons[i]}'></div>
3559
3559
<div>${gantt3.locale.labels[buttons[i]]}</div>
3560
3560
</div>`;
3561
3561
}
@@ -4221,7 +4221,7 @@ function tooltip(gantt2) {
4221
4221
});
4222
4222
}
4223
4223
const noTrack = { onBeforeUndo: "onAfterUndo", onBeforeRedo: "onAfterRedo" };
4224
- const batchActions = ["onTaskDragStart", "onAfterTaskUpdate", "onAfterTaskDelete", "onBeforeBatchUpdate"];
4224
+ const batchActions = ["onTaskDragStart", "onAfterTaskUpdate", "onAfterParentExpand", " onAfterTaskDelete", "onBeforeBatchUpdate"];
4225
4225
class Monitor {
4226
4226
constructor(undo2, gantt2) {
4227
4227
this._batchAction = null;
@@ -4432,6 +4432,9 @@ class Monitor {
4432
4432
gantt2.attachEvent("onAfterTaskUpdate", (id, task) => {
4433
4433
this.onTaskUpdated(task);
4434
4434
});
4435
+ gantt2.attachEvent("onAfterParentExpand", (id, task) => {
4436
+ this.onTaskUpdated(task);
4437
+ });
4435
4438
gantt2.attachEvent("onAfterTaskDelete", (id, task) => {
4436
4439
this.onTaskDeleted(task);
4437
4440
});
@@ -4755,7 +4758,13 @@ class Undo {
4755
4758
} else if (command.type === actions.update) {
4756
4759
const item = gantt2[getMethod](command.value.id);
4757
4760
for (const prop in command.value) {
4758
- if (!prop.startsWith("$") && !prop.startsWith("_")) {
4761
+ const internalProperty = prop.startsWith("$") || prop.startsWith("_");
4762
+ const whitelist = ["$open"];
4763
+ let copyProperty = !internalProperty;
4764
+ if (whitelist.indexOf(prop) > -1) {
4765
+ copyProperty = true;
4766
+ }
4767
+ if (copyProperty) {
4759
4768
item[prop] = command.value[prop];
4760
4769
}
4761
4770
}
@@ -5784,7 +5793,7 @@ function DnD(gantt2) {
5784
5793
if (this._settings) mixin(this.config, this._settings, true);
5785
5794
this.traceDragEvents(obj, inputMethod);
5786
5795
gantt2._prevent_touch_scroll = true;
5787
- document.body.className += " gantt_noselect";
5796
+ document.body.classList.add(" gantt_noselect") ;
5788
5797
if (gantt2.config.touch) {
5789
5798
this.dragMove(obj, e, inputMethod.accessor);
5790
5799
}
@@ -5831,7 +5840,7 @@ function DnD(gantt2) {
5831
5840
}
5832
5841
this.config.started = false;
5833
5842
gantt2._touch_drag = false;
5834
- document.body.className = document.body.className.replace(" gantt_noselect", " ");
5843
+ document.body.classList.remove(" gantt_noselect");
5835
5844
}, getPosition: function(e) {
5836
5845
var x = 0, y = 0;
5837
5846
if (e.pageX || e.pageY) {
@@ -6017,6 +6026,10 @@ var createTasksDatastoreFacade = function() {
6017
6026
if (!defined(parent)) parent = this.getParent(item) || 0;
6018
6027
if (!this.isTaskExists(parent)) parent = this.config.root_id;
6019
6028
this.setParent(item, parent);
6029
+ if (this.getState().lightbox && this.isTaskExists(parent)) {
6030
+ var parentObj = this.getTask(parent);
6031
+ this.callEvent("onAfterParentExpand", [parent, parentObj]);
6032
+ }
6020
6033
return this.$data.tasksStore.addItem(item, index, parent);
6021
6034
}, deleteTask: function(id) {
6022
6035
id = replaceValidZeroId(id, this.config.root_id);
@@ -13427,6 +13440,9 @@ function data(gantt2) {
13427
13440
this.setParent(item, parent, true);
13428
13441
var parentObj = this.getTask(parent);
13429
13442
parentObj.$open = true;
13443
+ if (!this.config.details_on_create) {
13444
+ this.callEvent("onAfterParentExpand", [parent, parentObj]);
13445
+ }
13430
13446
}
13431
13447
if (!this.callEvent("onTaskCreated", [item])) {
13432
13448
return null;
@@ -14233,6 +14249,9 @@ function extend(gantt2) {
14233
14249
if (this.resetLightbox) {
14234
14250
this.resetLightbox();
14235
14251
}
14252
+ if (this.ext.inlineEditors) {
14253
+ this.ext.inlineEditors.destructor();
14254
+ }
14236
14255
if (this._dp && this._dp.destructor) {
14237
14256
this._dp.destructor();
14238
14257
}
@@ -14295,7 +14314,7 @@ function i18nFactory() {
14295
14314
}
14296
14315
function DHXGantt() {
14297
14316
this.constants = constants;
14298
- this.version = "9.0.2 ";
14317
+ this.version = "9.0.3 ";
14299
14318
this.license = "gpl";
14300
14319
this.templates = {};
14301
14320
this.ext = {};
@@ -19428,7 +19447,7 @@ function create(gantt2) {
19428
19447
if (gantt2.isTaskExists(prev)) {
19429
19448
this.startEdit(prev, this._columnName);
19430
19449
}
19431
- }, destructor : function() {
19450
+ }, detachStore : function() {
19432
19451
handlers.forEach(function(handlerId) {
19433
19452
store.detachEvent(handlerId);
19434
19453
});
@@ -19439,6 +19458,8 @@ function create(gantt2) {
19439
19458
ganttHandlers = [];
19440
19459
store = null;
19441
19460
this.hide();
19461
+ }, destructor: function() {
19462
+ this.detachStore();
19442
19463
this.detachAllEvents();
19443
19464
} };
19444
19465
mixin(controller, keyboardMapping);
@@ -20696,11 +20717,6 @@ function createResourceTimelineBuilder(gantt2) {
20696
20717
if (cachedTimes[timestamp] === false) {
20697
20718
continue;
20698
20719
}
20699
- var isWorkTime = calendar.isWorkTime({ date: date2, task, unit: scaleUnit });
20700
- if (!isWorkTime) {
20701
- cachedTimes[timestamp] = false;
20702
- continue;
20703
- }
20704
20720
if (!timegrid[timestamp]) {
20705
20721
timegrid[timestamp] = { tasks: [], assignments: [] };
20706
20722
}
@@ -21496,7 +21512,7 @@ var initializer$2 = /* @__PURE__ */ function() {
21496
21512
}
21497
21513
}, onDestroyed: function(grid) {
21498
21514
if (grid.$config.id == "grid") {
21499
- gantt2.ext.inlineEditors.destructor ();
21515
+ gantt2.ext.inlineEditors.detachStore ();
21500
21516
}
21501
21517
this.clearEvents(grid, gantt2);
21502
21518
}, initEvents: function(grid, gantt3) {
@@ -23304,6 +23320,16 @@ class TimelineZoom {
23304
23320
const chartConfig = gantt3.copy(nextConfig);
23305
23321
delete chartConfig.name;
23306
23322
gantt3.mixin(gantt3.config, chartConfig, true);
23323
+ const resourceViews = ["resourceTimeline", "resourceHistogram"];
23324
+ resourceViews.forEach(function(name) {
23325
+ const resourceView = gantt3.$ui.getView(name);
23326
+ if (resourceView) {
23327
+ const resourceConfig = resourceView.$getConfig();
23328
+ if (!resourceConfig.fixed_scales) {
23329
+ gantt3.mixin(resourceConfig, chartConfig, true);
23330
+ }
23331
+ }
23332
+ });
23307
23333
const isRendered = !!gantt3.$root && !!gantt3.$task;
23308
23334
if (isRendered) {
23309
23335
if (cursorOffset) {
@@ -24753,7 +24779,7 @@ function lightbox(gantt2) {
24753
24779
}
24754
24780
} else {
24755
24781
index = src.getAttribute("data-index");
24756
- sec = src.parentNode ;
24782
+ sec = src.closest(".gantt_cal_lsection") ;
24757
24783
src = src.firstChild;
24758
24784
}
24759
24785
}
0 commit comments