1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.1.11 Standard
4
+ dhtmlxGantt v.7.1.12 Standard
5
5
6
6
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
7
7
@@ -7530,6 +7530,13 @@ module.exports = function (gantt) {
7530
7530
modifiedDate.setTime(modifiedDate.getTime() + 60 * 60 * 1000 * (24 - modifiedDate.getHours()));
7531
7531
}
7532
7532
7533
+ var worktimeCalculation = inc > 1;
7534
+
7535
+ if (worktimeCalculation && getHoursCondition) {
7536
+ // try to shift the modified Date to 00:00
7537
+ modifiedDate.setHours(0);
7538
+ }
7539
+
7533
7540
return modifiedDate;
7534
7541
},
7535
7542
add: function add(date, inc, mode) {
@@ -8699,7 +8706,8 @@ module.exports = function (gantt) {
8699
8706
};
8700
8707
8701
8708
var getDefaultTaskDate = function getDefaultTaskDate(item, parent_id) {
8702
- var parent = parent_id && parent_id != gantt.config.root_id ? gantt.getTask(parent_id) : false,
8709
+ var parentExists = parent_id && parent_id != gantt.config.root_id && gantt.isTaskExists(parent_id);
8710
+ var parent = parentExists ? gantt.getTask(parent_id) : false,
8703
8711
startDate = null;
8704
8712
8705
8713
if (parent) {
@@ -12830,11 +12838,12 @@ var createDatastoreFacade = function createDatastoreFacade() {
12830
12838
store.select(id); // GS-730. Split task is not included in the tree,
12831
12839
// so the datastore renderer will think that the task is not visible
12832
12840
12833
- if (oldSelectId && store.pull[oldSelectId].$split_subtask) {
12841
+ if (oldSelectId && store.pull[oldSelectId].$split_subtask && oldSelectId != id ) {
12834
12842
this.refreshTask(oldSelectId);
12835
12843
}
12836
12844
12837
- if (store.pull[id].$split_subtask) {
12845
+ if (store.pull[id].$split_subtask && oldSelectId != id) {
12846
+ // GS-1850. Do not repaint split task after double click
12838
12847
this.refreshTask(id);
12839
12848
}
12840
12849
}
@@ -12896,7 +12905,13 @@ var createLinksStoreFacade = function createLinksStoreFacade() {
12896
12905
return this.$data.linksStore.exists(id);
12897
12906
},
12898
12907
addLink: function addLink(link) {
12899
- return this.$data.linksStore.addItem(link);
12908
+ var newLink = this.$data.linksStore.addItem(link); // GS-1222. Update fullOrder otherwise the link won't appear after render
12909
+
12910
+ if (this.$data.linksStore.isSilent()) {
12911
+ this.$data.linksStore.fullOrder.push(newLink);
12912
+ }
12913
+
12914
+ return newLink;
12900
12915
},
12901
12916
updateLink: function updateLink(id, data) {
12902
12917
if (!utils.defined(data)) data = this.getLink(id);
@@ -13135,7 +13150,7 @@ function createLayoutFacade() {
13135
13150
} else {
13136
13151
var grid = getGrid(gantt);
13137
13152
13138
- if (grid || !grid.$config.hidden) {
13153
+ if (grid && !grid.$config.hidden) {
13139
13154
return grid;
13140
13155
} else {
13141
13156
return null;
@@ -13156,6 +13171,11 @@ function createLayoutFacade() {
13156
13171
baseCell = getGrid(gantt);
13157
13172
} else {
13158
13173
baseCell = getBaseCell(gantt);
13174
+ } // GS-1827. If there is no grid and timeline, there is no scrollbar for them
13175
+
13176
+
13177
+ if (!baseCell) {
13178
+ return null;
13159
13179
}
13160
13180
13161
13181
var verticalScrollbar = getAttachedScrollbar(gantt, baseCell, "scrollY");
@@ -13165,7 +13185,7 @@ function createLayoutFacade() {
13165
13185
function getHorizontalScrollbar(gantt) {
13166
13186
var baseCell = getBaseCell(gantt);
13167
13187
13168
- if (baseCell.id == "grid") {
13188
+ if (!baseCell || baseCell.id == "grid") {
13169
13189
return null; // if the timeline is not displayed, do not return the scrollbar
13170
13190
}
13171
13191
@@ -20252,11 +20272,53 @@ var Layout = function (_super) {
20252
20272
}
20253
20273
20254
20274
var autosize = this._getAutosizeMode(this.$config.autosize);
20275
+ /* // possible to rollback set content size when autisize is disabled, not sure if need to
20276
+ contentViews.forEach(function(view){
20277
+ const parent = view.$parent;
20278
+ if(!autosize.x){
20279
+ if(parent.$config.$originalWidthStored){
20280
+ parent.$config.$originalWidthStored = false;
20281
+ parent.$config.width = parent.$config.$originalWidth;
20282
+ parent.$config.$originalWidth = undefined;
20283
+ }
20284
+ }
20285
+
20286
+ if(!autosize.y){
20287
+ if(parent.$config.$originalHeightStored){
20288
+ parent.$config.$originalHeightStored = false;
20289
+ parent.$config.height = parent.$config.$originalHeight;
20290
+ parent.$config.$originalHeight = undefined;
20291
+ }
20292
+ }
20293
+ });*/
20294
+
20255
20295
20256
20296
var scrollChanged = this._resizeScrollbars(autosize, scrollbars);
20257
20297
20258
20298
if (this.$config.autosize) {
20259
20299
this.autosize(this.$config.autosize);
20300
+ contentViews.forEach(function (view) {
20301
+ var parent = view.$parent;
20302
+ var sizes = parent.getContentSize(autosize);
20303
+
20304
+ if (autosize.x) {
20305
+ if (!parent.$config.$originalWidthStored) {
20306
+ parent.$config.$originalWidthStored = true;
20307
+ parent.$config.$originalWidth = parent.$config.width;
20308
+ }
20309
+
20310
+ parent.$config.width = sizes.width;
20311
+ }
20312
+
20313
+ if (autosize.y) {
20314
+ if (!parent.$config.$originalHeightStored) {
20315
+ parent.$config.$originalHeightStored = true;
20316
+ parent.$config.$originalHeight = parent.$config.height;
20317
+ }
20318
+
20319
+ parent.$config.height = sizes.height;
20320
+ }
20321
+ });
20260
20322
scrollChanged = true;
20261
20323
}
20262
20324
@@ -22738,6 +22800,11 @@ module.exports = function (gantt) {
22738
22800
lightboxDiv.firstChild.style.cursor = "pointer";
22739
22801
22740
22802
gantt._init_dnd_events();
22803
+ } // GS-1428: If there is lightbox node, we need to remove it from the DOM
22804
+
22805
+
22806
+ if (this._lightbox) {
22807
+ this.resetLightbox();
22741
22808
}
22742
22809
22743
22810
document.body.insertBefore(lightboxDiv, document.body.firstChild);
@@ -33201,7 +33268,13 @@ CalendarWorkTimeStrategy.prototype = {
33201
33268
return timestamp;
33202
33269
},
33203
33270
_checkIfWorkingUnit: function _checkIfWorkingUnit(date, unit) {
33204
- if (!this["_is_work_" + unit]) return true;
33271
+ // GS-596: If unit is larger than day or has a custom logic
33272
+ if (!this["_is_work_" + unit]) {
33273
+ var from = this.$gantt.date["".concat(unit, "_start")](new Date(date));
33274
+ var to = this.$gantt.date.add(from, 1, unit);
33275
+ return this.hasDuration(from, to);
33276
+ }
33277
+
33205
33278
return this["_is_work_" + unit](date);
33206
33279
},
33207
33280
//checkings for particular time units
@@ -33913,23 +33986,23 @@ CalendarWorkTimeStrategy.prototype = {
33913
33986
_addInterval: function _addInterval(start, duration, unit, step, stopAction) {
33914
33987
var added = 0;
33915
33988
var current = start;
33916
- var previous = new Date(current.valueOf() - 1);
33917
- var timezoneDifferenceWithPrevious = current.getTimezoneOffset() - previous.getTimezoneOffset();
33989
+ var dstShift = false;
33918
33990
33919
33991
while (added < duration && !(stopAction && stopAction(current))) {
33920
- var next = this._nextDate(current, unit, step);
33992
+ var next = this._nextDate(current, unit, step); // GS-1501. Correct hours after DST change
33921
33993
33922
- if (timezoneDifferenceWithPrevious < 0 && step > 0) {
33923
- // the step parameter is for backward scheduling and startDate calcuation
33924
- next.setTime(next.getTime() + 60 * 1000 * timezoneDifferenceWithPrevious);
33925
- timezoneDifferenceWithPrevious = false;
33926
- }
33927
33994
33928
- var timezoneDifference = next.getTimezoneOffset() - current.getTimezoneOffset();
33995
+ if (unit == "day") {
33996
+ dstShift = dstShift || !current.getHours() && next.getHours();
33929
33997
33930
- if (timezoneDifference < 0 && step > 0 && unit != "day") {
33931
- // the step parameter is for backward scheduling and startDate calcuation
33932
- next.setTime(next.getTime() + 60 * 1000 * timezoneDifference);
33998
+ if (dstShift) {
33999
+ next.setHours(0);
34000
+
34001
+ if (next.getHours()) {// the day when the timezone is changed, try to correct hours next time
34002
+ } else {
34003
+ dstShift = false;
34004
+ }
34005
+ }
33933
34006
}
33934
34007
33935
34008
var dateValue = new Date(next.valueOf() + 1);
@@ -33940,7 +34013,7 @@ CalendarWorkTimeStrategy.prototype = {
33940
34013
33941
34014
var workTimeCheck = this._isWorkTime(dateValue, unit);
33942
34015
33943
- if (workTimeCheck) {
34016
+ if (workTimeCheck && !dstShift ) {
33944
34017
added++;
33945
34018
}
33946
34019
@@ -38276,6 +38349,19 @@ module.exports = function (gantt) {
38276
38349
var multiSelect = gantt.config.multiselect;
38277
38350
38278
38351
var singleSelection = function () {
38352
+ // GS-719: If the multiselect extension is added we still need a way
38353
+ // to open the inline editors after clicking on the cells in the grid
38354
+ var controller = gantt.ext.inlineEditors;
38355
+ var state = controller.getState();
38356
+ var cell = controller.locateCell(e.target);
38357
+
38358
+ if (gantt.config.inline_editors_multiselect_open && cell && controller.getEditorConfig(cell.columnName)) {
38359
+ if (controller.isVisible() && state.id == cell.id && state.columnName == cell.columnName) {// do nothing if editor is already active in this cell
38360
+ } else {
38361
+ controller.startEdit(cell.id, cell.columnName);
38362
+ }
38363
+ }
38364
+
38279
38365
this.setFirstSelected(target_ev);
38280
38366
38281
38367
if (!this.isSelected(target_ev)) {
@@ -40050,7 +40136,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
40050
40136
40051
40137
function DHXGantt() {
40052
40138
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
40053
- this.version = "7.1.11 ";
40139
+ this.version = "7.1.12 ";
40054
40140
this.license = "gpl";
40055
40141
this.templates = {};
40056
40142
this.ext = {};
0 commit comments