|
1 | 1 | /** @license
|
2 | 2 |
|
3 |
| -dhtmlxGantt v.9.0.10 Standard |
| 3 | +dhtmlxGantt v.9.0.11 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 |
|
@@ -952,9 +952,9 @@ class EventsManager2 {
|
952 | 952 | const gantt3 = this._gantt;
|
953 | 953 | this._trace = [];
|
954 | 954 | gantt3.$root.classList.remove("gantt_noselect");
|
955 |
| - if (this._originalReadonly !== void 0) { |
| 955 | + if (this._originalReadonly !== void 0 && this._mouseDown) { |
956 | 956 | gantt3.config.readonly = this._originalReadonly;
|
957 |
| - if (this._mouseDown && gantt3.config.drag_timeline && gantt3.config.drag_timeline.render) { |
| 957 | + if (gantt3.config.drag_timeline && gantt3.config.drag_timeline.render) { |
958 | 958 | gantt3.render();
|
959 | 959 | }
|
960 | 960 | }
|
@@ -5068,7 +5068,7 @@ const config = () => {
|
5068 | 5068 | return result;
|
5069 | 5069 | };
|
5070 | 5070 | var isWindowAwailable = typeof window !== "undefined";
|
5071 |
| -const env = { isIE: isWindowAwailable && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0), isIE6: isWindowAwailable && (!XMLHttpRequest && navigator.userAgent.indexOf("MSIE") >= 0), isIE7: isWindowAwailable && (navigator.userAgent.indexOf("MSIE 7.0") >= 0 && navigator.userAgent.indexOf("Trident") < 0), isIE8: isWindowAwailable && (navigator.userAgent.indexOf("MSIE 8.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0), isOpera: isWindowAwailable && navigator.userAgent.indexOf("Opera") >= 0, isChrome: isWindowAwailable && navigator.userAgent.indexOf("Chrome") >= 0, isKHTML: isWindowAwailable && (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0), isFF: isWindowAwailable && navigator.userAgent.indexOf("Firefox") >= 0, isIPad: isWindowAwailable && navigator.userAgent.search(/iPad/gi) >= 0, isEdge: isWindowAwailable && navigator.userAgent.indexOf("Edge") != -1, isNode: !isWindowAwailable || typeof navigator == "undefined" || false === "test" }; |
| 5071 | +const env = { isIE: isWindowAwailable && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0), isOpera: isWindowAwailable && (navigator.userAgent.indexOf("Opera") >= 0 || navigator.userAgent.indexOf("OPR") >= 0), isChrome: isWindowAwailable && navigator.userAgent.indexOf("Chrome") >= 0, isSafari: isWindowAwailable && (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0), isFF: isWindowAwailable && navigator.userAgent.indexOf("Firefox") >= 0, isIPad: isWindowAwailable && navigator.userAgent.search(/iPad/gi) >= 0, isEdge: isWindowAwailable && navigator.userAgent.indexOf("Edge") != -1, isNode: !isWindowAwailable || typeof navigator == "undefined" || false === "test", isSalesforce: isWindowAwailable && (!!scope["Sfdc"] || !!scope["$A"] || scope["Aura"]) }; |
5072 | 5072 | function serialize(data2) {
|
5073 | 5073 | if (typeof data2 === "string" || typeof data2 === "number") {
|
5074 | 5074 | return data2;
|
@@ -11852,8 +11852,12 @@ WorkTimeCalendarMerger.prototype = { _getIntervals: function(hoursArray) {
|
11852 | 11852 | }, _mergeHoursConfig: function(firstHours, secondHours) {
|
11853 | 11853 | return this._mergeAdjacentIntervals(this._intersectHourRanges(firstHours, secondHours));
|
11854 | 11854 | }, merge: function(first, second) {
|
11855 |
| - var firstConfig = copy(first.getConfig().parsed); |
11856 |
| - var secondConfig = copy(second.getConfig().parsed); |
| 11855 | + const firstCalendar = copy(first.getConfig()); |
| 11856 | + const secondCalendar = copy(second.getConfig()); |
| 11857 | + const firstConfig = firstCalendar.parsed; |
| 11858 | + const secondConfig = secondCalendar.parsed; |
| 11859 | + firstConfig.customWeeks = firstCalendar.customWeeks; |
| 11860 | + secondConfig.customWeeks = secondCalendar.customWeeks; |
11857 | 11861 | var mergedSettings = { hours: this._toHoursArray(this._mergeHoursConfig(firstConfig.hours, secondConfig.hours)), dates: {}, customWeeks: {} };
|
11858 | 11862 | const processCalendar = (config1, config2) => {
|
11859 | 11863 | for (let i2 in config1.dates) {
|
@@ -11882,7 +11886,11 @@ WorkTimeCalendarMerger.prototype = { _getIntervals: function(hoursArray) {
|
11882 | 11886 | }
|
11883 | 11887 | if (secondConfig.customWeeks) {
|
11884 | 11888 | for (var i in secondConfig.customWeeks) {
|
11885 |
| - mergedSettings.customWeeks[i] = secondConfig.customWeeks[i]; |
| 11889 | + if (mergedSettings.customWeeks[i]) { |
| 11890 | + mergedSettings.customWeeks[i + "_second"] = secondConfig.customWeeks[i]; |
| 11891 | + } else { |
| 11892 | + mergedSettings.customWeeks[i] = secondConfig.customWeeks[i]; |
| 11893 | + } |
11886 | 11894 | }
|
11887 | 11895 | }
|
11888 | 11896 | return mergedSettings;
|
@@ -13272,7 +13280,7 @@ CalendarManager.prototype = { _calendars: {}, _convertWorkTimeSettings: function
|
13272 | 13280 | } else {
|
13273 | 13281 | resourceProperty = legacyResourceCalendarConfig.getResourceProperty(config2);
|
13274 | 13282 | }
|
13275 |
| - if (Array.isArray(task[resourceProperty])) { |
| 13283 | + if (Array.isArray(task[resourceProperty]) && task[resourceProperty].length) { |
13276 | 13284 | if (config2.dynamic_resource_calendars) {
|
13277 | 13285 | calendarId = dynamicResourceCalendars.getCalendarIdFromMultipleResources(task[resourceProperty], this);
|
13278 | 13286 | } else {
|
@@ -14086,8 +14094,7 @@ function addResizeListener(gantt2) {
|
14086 | 14094 | resizeWatcher.setAttribute("role", "none");
|
14087 | 14095 | resizeWatcher.setAttribute("aria-hidden", true);
|
14088 | 14096 | }
|
14089 |
| - var salesforce_environment = !!window["Sfdc"] || !!window["$A"] || window["Aura"]; |
14090 |
| - if (salesforce_environment) { |
| 14097 | + if (gantt2.env.isSalesforce) { |
14091 | 14098 | gantt2.config.container_resize_method = "timeout";
|
14092 | 14099 | }
|
14093 | 14100 | gantt2.$root.appendChild(resizeWatcher);
|
@@ -14543,7 +14550,7 @@ function i18nFactory() {
|
14543 | 14550 | }
|
14544 | 14551 | function DHXGantt() {
|
14545 | 14552 | this.constants = constants;
|
14546 |
| - this.version = "9.0.10"; |
| 14553 | + this.version = "9.0.11"; |
14547 | 14554 | this.license = "gpl";
|
14548 | 14555 | this.templates = {};
|
14549 | 14556 | this.ext = {};
|
@@ -14698,6 +14705,8 @@ function messages(gantt2) {
|
14698 | 14705 | messageBox.area = document.createElement("div");
|
14699 | 14706 | messageBox.area.className = "gantt_message_area";
|
14700 | 14707 | messageBox.area.style[messageBox.position] = "5px";
|
| 14708 | + } |
| 14709 | + if (!isChildOf(messageBox.area, document.body)) { |
14701 | 14710 | document.body.appendChild(messageBox.area);
|
14702 | 14711 | }
|
14703 | 14712 | messageBox.hide(text.id);
|
@@ -15477,17 +15486,17 @@ var layerFactory = function(gantt2) {
|
15477 | 15486 | layer.id = layer.id || uid();
|
15478 | 15487 | this.tempCollection.push(layer);
|
15479 | 15488 | }
|
15480 |
| - var container = this.container(); |
15481 |
| - var pending = this.tempCollection; |
15482 |
| - for (var i = 0; i < pending.length; i++) { |
| 15489 | + const container = this.container(); |
| 15490 | + const pending = this.tempCollection; |
| 15491 | + for (let i = 0; i < pending.length; i++) { |
15483 | 15492 | layer = pending[i];
|
15484 |
| - if (!this.container() && !(layer && layer.container && isChildOf(layer.container, document.body))) continue; |
15485 |
| - var node = layer.container, id = layer.id, topmost = layer.topmost; |
| 15493 | + if (!this.container() && !(layer && layer.container && layer.container.isConnected)) continue; |
| 15494 | + let node = layer.container, id = layer.id, topmost = layer.topmost; |
15486 | 15495 | if (!node.parentNode) {
|
15487 | 15496 | if (topmost) {
|
15488 | 15497 | container.appendChild(node);
|
15489 | 15498 | } else {
|
15490 |
| - var rel = relativeRoot ? relativeRoot() : container.firstChild; |
| 15499 | + let rel = relativeRoot ? relativeRoot() : container.firstChild; |
15491 | 15500 | if (rel && rel.parentNode == container) container.insertBefore(node, rel);
|
15492 | 15501 | else container.appendChild(node);
|
15493 | 15502 | }
|
@@ -20970,7 +20979,7 @@ function createGridLineRender(gantt2) {
|
20970 | 20979 | for (var i = 0; i < columns.length; i++) {
|
20971 | 20980 | var column = columns[i];
|
20972 | 20981 | if (column.onrender) {
|
20973 |
| - var cellNode = rowNode.querySelector("[data-column-name=" + column.name + "]"); |
| 20982 | + var cellNode = rowNode.querySelector(`[data-column-name="${column.name}"]`); |
20974 | 20983 | if (cellNode) {
|
20975 | 20984 | var content = column.onrender(item, cellNode);
|
20976 | 20985 | if (content && typeof content === "string") {
|
@@ -24940,8 +24949,7 @@ function lightbox(gantt2) {
|
24940 | 24949 | gantt2._lightbox_root = gantt2.$root;
|
24941 | 24950 | function setParentNode() {
|
24942 | 24951 | const cspEnvironment = gantt2.config.csp === true;
|
24943 |
| - const salesforceEnvironment = !!window["Sfdc"] || !!window["$A"] || window["Aura"] || "$shadowResolver$" in document.body; |
24944 |
| - if (cspEnvironment || salesforceEnvironment) { |
| 24952 | + if (cspEnvironment || gantt2.env.isSalesforce) { |
24945 | 24953 | gantt2._lightbox_root = gantt2.$root;
|
24946 | 24954 | } else {
|
24947 | 24955 | gantt2._lightbox_root = document.body;
|
@@ -25262,22 +25270,27 @@ function lightbox(gantt2) {
|
25262 | 25270 | return mapping;
|
25263 | 25271 | };
|
25264 | 25272 | gantt2.getLightboxValues = function() {
|
25265 |
| - var task = {}; |
| 25273 | + let task = {}; |
25266 | 25274 | if (gantt2.isTaskExists(this._lightbox_id)) {
|
25267 | 25275 | task = this.mixin({}, this.getTask(this._lightbox_id));
|
25268 | 25276 | }
|
25269 |
| - var sns = this._get_typed_lightbox_config(); |
25270 |
| - for (var i = 0; i < sns.length; i++) { |
25271 |
| - var node = gantt2._lightbox_root.querySelector("#" + sns[i].id); |
| 25277 | + const sns = this._get_typed_lightbox_config(); |
| 25278 | + const sortedSns = [...sns].sort((a, b) => { |
| 25279 | + if (a.name === "time") return 1; |
| 25280 | + if (b.name === "time") return -1; |
| 25281 | + return 0; |
| 25282 | + }); |
| 25283 | + for (let i = 0; i < sortedSns.length; i++) { |
| 25284 | + let node = gantt2._lightbox_root.querySelector("#" + sortedSns[i].id); |
25272 | 25285 | node = node ? node.nextSibling : node;
|
25273 |
| - var block = this.form_blocks[sns[i].type]; |
| 25286 | + let block = this.form_blocks[sortedSns[i].type]; |
25274 | 25287 | if (!block) continue;
|
25275 |
| - var res = block.get_value.call(this, node, task, sns[i]); |
25276 |
| - var map_to = gantt2._resolve_default_mapping(sns[i]); |
| 25288 | + let res = block.get_value.call(this, node, task, sortedSns[i]); |
| 25289 | + let map_to = gantt2._resolve_default_mapping(sortedSns[i]); |
25277 | 25290 | if (typeof map_to == "string" && map_to != "auto") {
|
25278 | 25291 | task[map_to] = res;
|
25279 | 25292 | } else if (typeof map_to == "object") {
|
25280 |
| - for (var property in map_to) { |
| 25293 | + for (let property in map_to) { |
25281 | 25294 | if (map_to[property]) task[map_to[property]] = res[property];
|
25282 | 25295 | }
|
25283 | 25296 | }
|
|
0 commit comments