dhtmlx-scheduler 6.0.0 → 6.0.1

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.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @license
3
3
  *
4
- * dhtmlxScheduler v.6.0.0 Standard
4
+ * dhtmlxScheduler v.6.0.1 Standard
5
5
  *
6
6
  * To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com
7
7
  *
@@ -5464,64 +5464,12 @@ function extend(scheduler) {
5464
5464
  "use strict";
5465
5465
  __webpack_require__.r(__webpack_exports__);
5466
5466
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return extend; });
5467
+ /* harmony import */ var _utils_scoped_event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/scoped_event */ "./sources/core/utils/scoped_event.js");
5467
5468
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
5468
5469
 
5469
- function extend(scheduler) {
5470
- var defaultDomEvents = {
5471
- event: function event(el, _event, handler) {
5472
- if (el.addEventListener) el.addEventListener(_event, handler, false);else if (el.attachEvent) el.attachEvent("on" + _event, handler);
5473
- },
5474
- eventRemove: function eventRemove(el, event, handler) {
5475
- if (el.removeEventListener) el.removeEventListener(event, handler, false);else if (el.detachEvent) el.detachEvent("on" + event, handler);
5476
- }
5477
- };
5478
-
5479
- var domEvents = function (addEvent, removeEvent) {
5480
- addEvent = addEvent || defaultDomEvents.event;
5481
- removeEvent = removeEvent || defaultDomEvents.eventRemove;
5482
- var handlers = [];
5483
- var eventScope = {
5484
- attach: function attach(el, event, callback, capture) {
5485
- handlers.push({
5486
- element: el,
5487
- event: event,
5488
- callback: callback,
5489
- capture: capture
5490
- });
5491
- addEvent(el, event, callback, capture);
5492
- },
5493
- detach: function detach(el, event, callback, capture) {
5494
- removeEvent(el, event, callback, capture);
5495
-
5496
- for (var i = 0; i < handlers.length; i++) {
5497
- var handler = handlers[i];
5498
-
5499
- if (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {
5500
- handlers.splice(i, 1);
5501
- i--;
5502
- }
5503
- }
5504
- },
5505
- detachAll: function detachAll() {
5506
- var staticArray = handlers.slice(); // original handlers array can be spliced on every iteration
5507
-
5508
- for (var i = 0; i < staticArray.length; i++) {
5509
- var handler = staticArray[i];
5510
- eventScope.detach(handler.element, handler.event, handler.callback, handler.capture);
5511
- eventScope.detach(handler.element, handler.event, handler.callback, undefined);
5512
- eventScope.detach(handler.element, handler.event, handler.callback, false);
5513
- eventScope.detach(handler.element, handler.event, handler.callback, true);
5514
- }
5515
-
5516
- handlers.splice(0, handlers.length);
5517
- },
5518
- extend: function extend() {
5519
- return domEvents(this.event, this.eventRemove);
5520
- }
5521
- };
5522
- return eventScope;
5523
- }();
5524
5470
 
5471
+ function extend(scheduler) {
5472
+ var domEvents = Object(_utils_scoped_event__WEBPACK_IMPORTED_MODULE_0__["default"])();
5525
5473
  scheduler.event = domEvents.attach;
5526
5474
  scheduler.eventRemove = domEvents.detach;
5527
5475
  scheduler._eventRemoveAll = domEvents.detachAll;
@@ -6327,9 +6275,11 @@ DataProcessor.prototype = {
6327
6275
  var action = this.getActionByState(state);
6328
6276
 
6329
6277
  var _onResolvedCreateUpdate = function _onResolvedCreateUpdate(tag) {
6278
+ var resultState = state;
6279
+
6330
6280
  if (tag && tag.responseText && tag.setRequestHeader) {
6331
6281
  if (tag.status !== 200) {
6332
- action = "error";
6282
+ resultState = "error";
6333
6283
  }
6334
6284
 
6335
6285
  try {
@@ -6337,17 +6287,17 @@ DataProcessor.prototype = {
6337
6287
  } catch (e) {}
6338
6288
  }
6339
6289
 
6340
- action = action || "updated";
6290
+ resultState = resultState || "updated";
6341
6291
  var sid = rowId;
6342
6292
  var tid = rowId;
6343
6293
 
6344
6294
  if (tag) {
6345
- action = tag.action || state;
6295
+ resultState = tag.action || resultState;
6346
6296
  sid = tag.sid || sid;
6347
6297
  tid = tag.id || tag.tid || tid;
6348
6298
  }
6349
6299
 
6350
- self.afterUpdateCallback(sid, tid, action, tag);
6300
+ self.afterUpdateCallback(sid, tid, resultState, tag);
6351
6301
  };
6352
6302
 
6353
6303
  var actionPromise;
@@ -7592,11 +7542,9 @@ function extend(scheduler) {
7592
7542
 
7593
7543
  var widt = pos.x2 - pos.x;
7594
7544
  var el = document.createElement("div");
7595
-
7596
- el.onclick = function (e) {
7545
+ scheduler.event(el, "click", function (e) {
7597
7546
  scheduler._view_month_day(e);
7598
- };
7599
-
7547
+ });
7600
7548
  el.className = "dhx_month_link";
7601
7549
  el.style.top = pos.y + "px";
7602
7550
  el.style.left = pos.x + "px";
@@ -8243,7 +8191,7 @@ function extend(scheduler) {
8243
8191
  this._editor = d2.querySelector("textarea");
8244
8192
  if (this._quirks7) this._editor.style.height = height - 12 + "px"; //IEFIX
8245
8193
 
8246
- this._editor.onkeydown = function (e) {
8194
+ scheduler.event(this._editor, "keydown", function (e) {
8247
8195
  if (e.shiftKey) return true;
8248
8196
  var code = e.keyCode;
8249
8197
  if (code == scheduler.keys.edit_save) scheduler.editStop(true);
@@ -8252,12 +8200,11 @@ function extend(scheduler) {
8252
8200
  if (code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel) {
8253
8201
  if (e.preventDefault) e.preventDefault();
8254
8202
  }
8255
- };
8256
-
8257
- this._editor.onselectstart = function (e) {
8203
+ });
8204
+ scheduler.event(this._editor, "selectstart", function (e) {
8258
8205
  e.cancelBubble = true;
8259
8206
  return true;
8260
- };
8207
+ });
8261
8208
 
8262
8209
  scheduler._focus(this._editor, true); //IE and opera can add x-scroll during focusing
8263
8210
 
@@ -8902,7 +8849,7 @@ function extend(scheduler) {
8902
8849
  var select = node.firstChild;
8903
8850
 
8904
8851
  if (!select._dhx_onchange && sns.onchange) {
8905
- select.onchange = sns.onchange;
8852
+ scheduler.event(select, "change", sns.onchange);
8906
8853
  select._dhx_onchange = true;
8907
8854
  }
8908
8855
 
@@ -9056,25 +9003,28 @@ function extend(scheduler) {
9056
9003
  s[map[0]].disabled = input.checked;
9057
9004
  s[map[0] + s.length / 2].disabled = input.checked;
9058
9005
 
9059
- input.onclick = function () {
9060
- if (input.checked) {
9061
- var obj = {};
9062
- scheduler.form_blocks.time.get_value(node, obj, config);
9063
- start_date = scheduler.date.date_part(obj.start_date);
9064
- end_date = scheduler.date.date_part(obj.end_date);
9065
- if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) end_date = scheduler.date.add(end_date, 1, "day");
9066
- } else {
9067
- start_date = null;
9068
- end_date = null;
9069
- }
9006
+ if (!input.$_eventAttached) {
9007
+ input.$_eventAttached = true;
9008
+ scheduler.event(input, "click", function () {
9009
+ if (input.checked) {
9010
+ var obj = {};
9011
+ scheduler.form_blocks.time.get_value(node, obj, config);
9012
+ start_date = scheduler.date.date_part(obj.start_date);
9013
+ end_date = scheduler.date.date_part(obj.end_date);
9014
+ if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) end_date = scheduler.date.add(end_date, 1, "day");
9015
+ } else {
9016
+ start_date = null;
9017
+ end_date = null;
9018
+ }
9070
9019
 
9071
- s[map[0]].disabled = input.checked;
9072
- s[map[0] + s.length / 2].disabled = input.checked;
9020
+ s[map[0]].disabled = input.checked;
9021
+ s[map[0] + s.length / 2].disabled = input.checked;
9073
9022
 
9074
- _fill_lightbox_select(s, 0, start_date || ev.start_date);
9023
+ _fill_lightbox_select(s, 0, start_date || ev.start_date);
9075
9024
 
9076
- _fill_lightbox_select(s, 4, end_date || ev.end_date);
9077
- };
9025
+ _fill_lightbox_select(s, 4, end_date || ev.end_date);
9026
+ });
9027
+ }
9078
9028
  }
9079
9029
 
9080
9030
  if (cfg.auto_end_date && cfg.event_duration) {
@@ -9091,7 +9041,10 @@ function extend(scheduler) {
9091
9041
  };
9092
9042
 
9093
9043
  for (var i = 0; i < 4; i++) {
9094
- s[i].onchange = _update_lightbox_select;
9044
+ if (!s[i].$_eventAttached) {
9045
+ s[i].$_eventAttached = true;
9046
+ scheduler.event(s[i], "change", _update_lightbox_select);
9047
+ }
9095
9048
  }
9096
9049
  }
9097
9050
 
@@ -9358,24 +9311,45 @@ function extend(scheduler) {
9358
9311
  scheduler.hideLightbox = scheduler.cancel_lightbox; // GS-1650 need to use cancel in order to fire onEventCancel event, which is important to refresh the state of recurring series
9359
9312
 
9360
9313
  scheduler._init_lightbox_events = function () {
9361
- this.getLightbox().onclick = function (e) {
9362
- var src = e.target;
9363
- if (!src.className) src = src.previousSibling;
9314
+ if (this.getLightbox().$_eventAttached) {
9315
+ return;
9316
+ }
9364
9317
 
9365
- if (src && src.className && scheduler._getClassName(src).indexOf("dhx_btn_set") > -1) {
9366
- // assistive software (e.g. jaws) can dispatch event on the top element of a button
9367
- src = src.querySelector("[dhx_button]");
9368
- if (!src) return;
9318
+ var lightbox = this.getLightbox();
9319
+ lightbox.$_eventAttached = true;
9320
+ scheduler.event(lightbox, "click", function (e) {
9321
+ var buttonTarget = scheduler.$domHelpers.closest(e.target, ".dhx_btn_set");
9322
+
9323
+ if (!buttonTarget) {
9324
+ var sectionButton = scheduler.$domHelpers.closest(e.target, ".dhx_custom_button[data-section-index]");
9325
+
9326
+ if (sectionButton) {
9327
+ var index = Number(sectionButton.getAttribute("data-section-index"));
9328
+ var block = scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
9329
+ block.button_click(scheduler.$domHelpers.closest(sectionButton, ".dhx_cal_lsection"), sectionButton, e);
9330
+ }
9331
+
9332
+ return;
9369
9333
  }
9370
9334
 
9371
- var className = scheduler._getClassName(src);
9335
+ var action = buttonTarget ? buttonTarget.getAttribute("data-action") : null;
9372
9336
 
9373
- if (src && className) switch (className) {
9337
+ switch (action) {
9374
9338
  case "dhx_save_btn":
9339
+ case "save":
9340
+ if (scheduler.config.readonly_active) {
9341
+ return;
9342
+ }
9343
+
9375
9344
  scheduler.save_lightbox();
9376
9345
  break;
9377
9346
 
9378
9347
  case "dhx_delete_btn":
9348
+ case "delete":
9349
+ if (scheduler.config.readonly_active) {
9350
+ return;
9351
+ }
9352
+
9379
9353
  var c = scheduler.locale.labels.confirm_deleting;
9380
9354
 
9381
9355
  scheduler._dhtmlx_confirm(c, scheduler.locale.labels.title_confirm_deleting, function () {
@@ -9388,37 +9362,15 @@ function extend(scheduler) {
9388
9362
  break;
9389
9363
 
9390
9364
  case "dhx_cancel_btn":
9365
+ case "cancel":
9391
9366
  scheduler.cancel_lightbox();
9392
9367
  break;
9393
9368
 
9394
9369
  default:
9395
- if (src.getAttribute("dhx_button")) {
9396
- scheduler.callEvent("onLightboxButton", [className, src, e]);
9397
- } else {
9398
- var index, block, sec;
9399
-
9400
- if (className.indexOf("dhx_custom_button") != -1) {
9401
- if (className.indexOf("dhx_custom_button_") != -1) {
9402
- index = src.parentNode.getAttribute("index");
9403
- sec = src.parentNode.parentNode;
9404
- } else {
9405
- index = src.getAttribute("index");
9406
- sec = src.parentNode;
9407
- src = src.firstChild;
9408
- }
9409
- }
9410
-
9411
- if (index) {
9412
- block = scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
9413
- block.button_click(index, src, sec, sec.nextSibling);
9414
- }
9415
- }
9416
-
9417
- break;
9370
+ scheduler.callEvent("onLightboxButton", [action, buttonTarget, e]);
9418
9371
  }
9419
- };
9420
-
9421
- this.getLightbox().onkeydown = function (e) {
9372
+ });
9373
+ scheduler.event(lightbox, "keydown", function (e) {
9422
9374
  var event = e || window.event;
9423
9375
  var target = e.target || e.srcElement;
9424
9376
  var buttonTarget = target.querySelector("[dhx_button]");
@@ -9446,6 +9398,10 @@ function extend(scheduler) {
9446
9398
  if (buttonTarget && buttonTarget.click) {
9447
9399
  buttonTarget.click();
9448
9400
  } else {
9401
+ if (scheduler.config.readonly_active) {
9402
+ return;
9403
+ }
9404
+
9449
9405
  scheduler.save_lightbox();
9450
9406
  }
9451
9407
 
@@ -9458,7 +9414,7 @@ function extend(scheduler) {
9458
9414
  default:
9459
9415
  break;
9460
9416
  }
9461
- };
9417
+ });
9462
9418
  };
9463
9419
 
9464
9420
  scheduler.setLightboxSize = function () {
@@ -9515,7 +9471,6 @@ function extend(scheduler) {
9515
9471
  if (scheduler.form_blocks.recurring) d.className += " dhx_cal_light_rec";
9516
9472
  if (scheduler.config.rtl) d.className += " dhx_cal_light_rtl";
9517
9473
  if (scheduler.config.responsive_lightbox) d.className += " dhx_cal_light_responsive";
9518
- if (/msie|MSIE 6/.test(navigator.userAgent)) d.className += " dhx_ie6";
9519
9474
  d.style.visibility = "hidden";
9520
9475
  var html = this._lightbox_template;
9521
9476
  var buttons = this.config.buttons_left;
@@ -9523,7 +9478,7 @@ function extend(scheduler) {
9523
9478
 
9524
9479
  for (var i = 0; i < buttons.length; i++) {
9525
9480
  ariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);
9526
- html += "<div " + ariaAttr + " class='dhx_btn_set dhx_" + (scheduler.config.rtl ? "right" : "left") + "_btn_set " + buttons[i] + "_set'><div dhx_button='1' class='" + buttons[i] + "'></div><div>" + scheduler.locale.labels[buttons[i]] + "</div></div>";
9481
+ html += "<div " + ariaAttr + " data-action='" + buttons[i] + "' class='dhx_btn_set dhx_" + (scheduler.config.rtl ? "right" : "left") + "_btn_set " + buttons[i] + "_set'><div class='" + buttons[i] + "'></div><div>" + scheduler.locale.labels[buttons[i]] + "</div></div>";
9527
9482
  }
9528
9483
 
9529
9484
  buttons = this.config.buttons_right;
@@ -9531,19 +9486,18 @@ function extend(scheduler) {
9531
9486
 
9532
9487
  for (var i = 0; i < buttons.length; i++) {
9533
9488
  ariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);
9534
- html += "<div " + ariaAttr + " class='dhx_btn_set dhx_" + (rtl ? "left" : "right") + "_btn_set " + buttons[i] + "_set' style='float:" + (rtl ? "left" : "right") + ";'><div dhx_button='1' class='" + buttons[i] + "'></div><div>" + scheduler.locale.labels[buttons[i]] + "</div></div>";
9489
+ html += "<div " + ariaAttr + " data-action='" + buttons[i] + "' class='dhx_btn_set dhx_" + (rtl ? "left" : "right") + "_btn_set " + buttons[i] + "_set' style='float:" + (rtl ? "left" : "right") + ";'><div class='" + buttons[i] + "'></div><div>" + scheduler.locale.labels[buttons[i]] + "</div></div>";
9535
9490
  }
9536
9491
 
9537
9492
  html += "</div>";
9538
9493
  d.innerHTML = html;
9539
9494
 
9540
9495
  if (scheduler.config.drag_lightbox) {
9541
- d.firstChild.onmousedown = scheduler._ready_to_dnd;
9542
-
9543
- d.firstChild.onselectstart = function () {
9496
+ scheduler.event(d.firstChild, "mousedown", scheduler._ready_to_dnd);
9497
+ scheduler.event(d.firstChild, "selectstart", function (e) {
9498
+ e.preventDefault();
9544
9499
  return false;
9545
- };
9546
-
9500
+ });
9547
9501
  d.firstChild.style.cursor = "move";
9548
9502
 
9549
9503
  scheduler._init_dnd_events();
@@ -9566,7 +9520,7 @@ function extend(scheduler) {
9566
9520
  if (sns[i].button) {
9567
9521
  var ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels["button_" + sns[i].button]);
9568
9522
 
9569
- button = "<div " + ariaAttr + " class='dhx_custom_button' index='" + i + "'><div class='dhx_custom_button_" + sns[i].button + "'></div><div>" + this.locale.labels["button_" + sns[i].button] + "</div></div>";
9523
+ button = "<div " + ariaAttr + " class='dhx_custom_button' data-section-index='" + i + "' index='" + i + "'><div class='dhx_custom_button_" + sns[i].button + "'></div><div>" + this.locale.labels["button_" + sns[i].button] + "</div></div>";
9570
9524
  }
9571
9525
 
9572
9526
  if (this.config.wide_form) {
@@ -9644,7 +9598,7 @@ function extend(scheduler) {
9644
9598
  var control = scheduler.form_blocks[section.type];
9645
9599
 
9646
9600
  if (control.focus) {
9647
- label.onclick = function (section) {
9601
+ scheduler.event(label, "click", function (section) {
9648
9602
  return function () {
9649
9603
  var block = scheduler.form_blocks[section.type];
9650
9604
 
@@ -9652,7 +9606,7 @@ function extend(scheduler) {
9652
9606
 
9653
9607
  if (block && block.focus) block.focus.call(scheduler, node);
9654
9608
  };
9655
- }(section);
9609
+ }(section));
9656
9610
  }
9657
9611
  }
9658
9612
  }
@@ -10395,7 +10349,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
10395
10349
  if (!modality.cover) {
10396
10350
  modality.cover = document.createElement("div"); //necessary for IE only
10397
10351
 
10398
- modality.cover.onkeydown = modal_key;
10352
+ scheduler.event(modality.cover, "keydown", modal_key);
10399
10353
  modality.cover.className = "dhx_modal_cover";
10400
10354
  document.body.appendChild(modality.cover);
10401
10355
  }
@@ -10423,11 +10377,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
10423
10377
  var message = document.createElement("div");
10424
10378
  message.innerHTML = "<div>" + text.text + "</div>";
10425
10379
  message.className = "scheduler-info dhtmlx-info scheduler-" + text.type + " dhtmlx-" + text.type;
10426
-
10427
- message.onclick = function () {
10380
+ scheduler.event(message, "click", function () {
10428
10381
  messageBox.hide(text.id);
10429
10382
  text = null;
10430
- };
10383
+ });
10431
10384
 
10432
10385
  scheduler._waiAria.messageInfoAttr(message);
10433
10386
 
@@ -10493,7 +10446,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
10493
10446
  box.childNodes[config.title ? 1 : 0].appendChild(node);
10494
10447
  }
10495
10448
 
10496
- box.onclick = function (event) {
10449
+ scheduler.event(box, "click", function (event) {
10497
10450
  var source = event.target || event.srcElement;
10498
10451
  if (!source.className) source = source.parentNode;
10499
10452
 
@@ -10502,8 +10455,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
10502
10455
  result = result == "true" || (result == "false" ? false : result);
10503
10456
  callback(config, result);
10504
10457
  }
10505
- };
10506
-
10458
+ });
10507
10459
  config.box = box;
10508
10460
  if (ok || cancel) _dhx_msg_cfg = config;
10509
10461
  return box;
@@ -10518,7 +10470,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
10518
10470
  if (config.position == "top") box.style.top = "-3px";else box.style.top = y + 'px';
10519
10471
  box.style.left = x + 'px'; //necessary for IE only
10520
10472
 
10521
- box.onkeydown = modal_key;
10473
+ scheduler.event(box, "keydown", modal_key);
10522
10474
  modalBox.focus(box);
10523
10475
  if (config.hidden) modalBox.hide(box);
10524
10476
  scheduler.callEvent("onMessagePopup", [box]);
@@ -10754,8 +10706,8 @@ function extend(scheduler) {
10754
10706
  minicalendarButton: function minicalendarButton(config) {
10755
10707
  var minicalendarDiv = div('dhx_minical_icon');
10756
10708
 
10757
- if (!config.click) {
10758
- minicalendarDiv.onclick = function () {
10709
+ if (!config.click && !minicalendarDiv.$_eventAttached) {
10710
+ scheduler.event(minicalendarDiv, "click", function () {
10759
10711
  if (scheduler.isCalendarVisible()) {
10760
10712
  scheduler.destroyCalendar();
10761
10713
  } else {
@@ -10769,7 +10721,7 @@ function extend(scheduler) {
10769
10721
  }
10770
10722
  });
10771
10723
  }
10772
- };
10724
+ });
10773
10725
  }
10774
10726
 
10775
10727
  return minicalendarDiv;
@@ -10974,6 +10926,7 @@ function extend(scheduler) {
10974
10926
  }
10975
10927
 
10976
10928
  if (heightChanged || configChanged) {
10929
+ scheduler.unset_actions();
10977
10930
  scheduler._els = [];
10978
10931
  scheduler.get_elements();
10979
10932
  scheduler.set_actions();
@@ -11262,54 +11215,48 @@ function extend(scheduler) {
11262
11215
  }
11263
11216
  };
11264
11217
 
11265
- scheduler.unset_actions = function () {
11266
- for (var a in this._els) {
11267
- if (this._click[a]) for (var i = 0; i < this._els[a].length; i++) {
11268
- this._els[a][i].onclick = null;
11269
- }
11270
- }
11218
+ var domEventsScope = scheduler._createDomEventScope();
11271
11219
 
11272
- this._obj.onselectstart = null;
11273
- this._obj.onmousemove = null;
11274
- this._obj.onmousedown = null;
11275
- this._obj.onmouseup = null;
11276
- this._obj.ondblclick = null;
11277
- this._obj.oncontextmenu = null;
11220
+ scheduler.unset_actions = function () {
11221
+ domEventsScope.detachAll();
11278
11222
  };
11279
11223
 
11280
11224
  scheduler.set_actions = function () {
11281
11225
  for (var a in this._els) {
11282
- if (this._click[a]) for (var i = 0; i < this._els[a].length; i++) {
11283
- this._els[a][i].onclick = scheduler._click[a];
11226
+ if (this._click[a]) {
11227
+ for (var i = 0; i < this._els[a].length; i++) {
11228
+ var element = this._els[a][i];
11229
+
11230
+ var handler = this._click[a].bind(element);
11231
+
11232
+ domEventsScope.attach(element, "click", handler);
11233
+ }
11284
11234
  }
11285
11235
  }
11286
11236
 
11287
- this._obj.onselectstart = function (e) {
11237
+ domEventsScope.attach(this._obj, "selectstart", function (e) {
11238
+ e.preventDefault();
11288
11239
  return false;
11289
- };
11240
+ }); //this._obj.onselectstart=function(e){ return false; };
11290
11241
 
11291
- this._obj.onmousemove = function (e) {
11242
+ domEventsScope.attach(this._obj, "mousemove", function (e) {
11292
11243
  if (!scheduler._temp_touch_block) scheduler._on_mouse_move(e);
11293
- };
11294
-
11295
- this._obj.onmousedown = function (e) {
11244
+ });
11245
+ domEventsScope.attach(this._obj, "mousedown", function (e) {
11296
11246
  if (!scheduler._ignore_next_click) scheduler._on_mouse_down(e);
11297
- };
11298
-
11299
- this._obj.onmouseup = function (e) {
11247
+ });
11248
+ domEventsScope.attach(this._obj, "mouseup", function (e) {
11300
11249
  if (!scheduler._ignore_next_click) scheduler._on_mouse_up(e);
11301
- };
11302
-
11303
- this._obj.ondblclick = function (e) {
11250
+ });
11251
+ domEventsScope.attach(this._obj, "dblclick", function (e) {
11304
11252
  scheduler._on_dbl_click(e);
11305
- };
11306
-
11307
- this._obj.oncontextmenu = function (e) {
11253
+ });
11254
+ domEventsScope.attach(this._obj, "contextmenu", function (e) {
11308
11255
  var ev = e;
11309
11256
  var src = ev.target || ev.srcElement;
11310
11257
  var returnValue = scheduler.callEvent("onContextMenu", [scheduler._locate_event(src), ev]);
11311
11258
  return returnValue;
11312
- };
11259
+ });
11313
11260
  };
11314
11261
 
11315
11262
  scheduler.select = function (id) {
@@ -12501,7 +12448,7 @@ function extend(scheduler) {
12501
12448
 
12502
12449
  c1.appendChild(c2);
12503
12450
  this._els[dhx_multi_day] = [c1, c2];
12504
- this._els[dhx_multi_day][0].onclick = this._click.dhx_cal_data;
12451
+ scheduler.event(this._els[dhx_multi_day][0], "click", this._click.dhx_cal_data);
12505
12452
  }
12506
12453
  }
12507
12454
  };
@@ -13896,7 +13843,7 @@ function extend(scheduler) {
13896
13843
  var isQt = navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null;
13897
13844
 
13898
13845
  if (!!async) {
13899
- t.onreadystatechange = function () {
13846
+ t.addEventListener("readystatechange", function () {
13900
13847
  if (t.readyState == 4 || isQt && t.readyState == 3) {
13901
13848
  // what for long response and status 404?
13902
13849
  if (t.status != 200 || t.responseText === "") if (!scheduler.callEvent("onAjaxError", [t])) return;
@@ -13916,7 +13863,7 @@ function extend(scheduler) {
13916
13863
  }
13917
13864
  }, 0);
13918
13865
  }
13919
- };
13866
+ });
13920
13867
  }
13921
13868
 
13922
13869
  if (method == "GET" && !this.cache) {
@@ -14387,6 +14334,89 @@ if (Element.prototype.closest) {
14387
14334
 
14388
14335
  /***/ }),
14389
14336
 
14337
+ /***/ "./sources/core/utils/event.js":
14338
+ /*!*************************************!*\
14339
+ !*** ./sources/core/utils/event.js ***!
14340
+ \*************************************/
14341
+ /*! exports provided: default */
14342
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
14343
+
14344
+ "use strict";
14345
+ __webpack_require__.r(__webpack_exports__);
14346
+ /* harmony default export */ __webpack_exports__["default"] = ({
14347
+ event: function event(el, _event, handler) {
14348
+ if (el.addEventListener) el.addEventListener(_event, handler, false);else if (el.attachEvent) el.attachEvent("on" + _event, handler);
14349
+ },
14350
+ eventRemove: function eventRemove(el, event, handler) {
14351
+ if (el.removeEventListener) el.removeEventListener(event, handler, false);else if (el.detachEvent) el.detachEvent("on" + event, handler);
14352
+ }
14353
+ });
14354
+
14355
+ /***/ }),
14356
+
14357
+ /***/ "./sources/core/utils/scoped_event.js":
14358
+ /*!********************************************!*\
14359
+ !*** ./sources/core/utils/scoped_event.js ***!
14360
+ \********************************************/
14361
+ /*! exports provided: default */
14362
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
14363
+
14364
+ "use strict";
14365
+ __webpack_require__.r(__webpack_exports__);
14366
+ /* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event */ "./sources/core/utils/event.js");
14367
+
14368
+ /* harmony default export */ __webpack_exports__["default"] = (function () {
14369
+ var domEvents = function domEvents(addEvent, removeEvent) {
14370
+ addEvent = addEvent || _event__WEBPACK_IMPORTED_MODULE_0__["default"].event;
14371
+ removeEvent = removeEvent || _event__WEBPACK_IMPORTED_MODULE_0__["default"].eventRemove;
14372
+ var handlers = [];
14373
+ var eventScope = {
14374
+ attach: function attach(el, event, callback, capture) {
14375
+ handlers.push({
14376
+ element: el,
14377
+ event: event,
14378
+ callback: callback,
14379
+ capture: capture
14380
+ });
14381
+ addEvent(el, event, callback, capture);
14382
+ },
14383
+ detach: function detach(el, event, callback, capture) {
14384
+ removeEvent(el, event, callback, capture);
14385
+
14386
+ for (var i = 0; i < handlers.length; i++) {
14387
+ var handler = handlers[i];
14388
+
14389
+ if (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {
14390
+ handlers.splice(i, 1);
14391
+ i--;
14392
+ }
14393
+ }
14394
+ },
14395
+ detachAll: function detachAll() {
14396
+ var staticArray = handlers.slice(); // original handlers array can be spliced on every iteration
14397
+
14398
+ for (var i = 0; i < staticArray.length; i++) {
14399
+ var handler = staticArray[i];
14400
+ eventScope.detach(handler.element, handler.event, handler.callback, handler.capture);
14401
+ eventScope.detach(handler.element, handler.event, handler.callback, undefined);
14402
+ eventScope.detach(handler.element, handler.event, handler.callback, false);
14403
+ eventScope.detach(handler.element, handler.event, handler.callback, true);
14404
+ }
14405
+
14406
+ handlers.splice(0, handlers.length);
14407
+ },
14408
+ extend: function extend() {
14409
+ return domEvents(this.event, this.eventRemove);
14410
+ }
14411
+ };
14412
+ return eventScope;
14413
+ };
14414
+
14415
+ return domEvents();
14416
+ });
14417
+
14418
+ /***/ }),
14419
+
14390
14420
  /***/ "./sources/core/utils/utils.js":
14391
14421
  /*!*************************************!*\
14392
14422
  !*** ./sources/core/utils/utils.js ***!
@@ -14968,8 +14998,8 @@ __webpack_require__.r(__webpack_exports__);
14968
14998
 
14969
14999
  scheduler._active_link_click = function (e) {
14970
15000
  var start = e.target;
14971
- var to = start.getAttribute("jump_to");
14972
- var s_d = scheduler.date.str_to_date(scheduler.config.api_date);
15001
+ var to = start.getAttribute("data-link-date");
15002
+ var s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);
14973
15003
 
14974
15004
  if (to) {
14975
15005
  scheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);
@@ -14990,7 +15020,7 @@ __webpack_require__.r(__webpack_exports__);
14990
15020
  var d_s = scheduler.date.date_to_str(scheduler.config.api_date);
14991
15021
 
14992
15022
  scheduler.templates[fullname] = function (date) {
14993
- return "<a jump_to='" + d_s(date) + "' href='#'>" + week_x(date) + "</a>";
15023
+ return "<a data-link-date='" + d_s(date) + "' href='#'>" + week_x(date) + "</a>";
14994
15024
  };
14995
15025
  };
14996
15026
 
@@ -16107,7 +16137,13 @@ __webpack_require__.r(__webpack_exports__);
16107
16137
 
16108
16138
  if (config.handler) {
16109
16139
  var checkbox = node.getElementsByTagName('input')[0];
16110
- checkbox.onclick = config.handler;
16140
+
16141
+ if (checkbox.$_eventAttached) {
16142
+ return;
16143
+ }
16144
+
16145
+ checkbox.$_eventAttached = true;
16146
+ scheduler.event(checkbox, "click", config.handler); //checkbox.onclick = config.handler;
16111
16147
  }
16112
16148
  },
16113
16149
  get_value: function get_value(node, ev, config) {
@@ -16189,9 +16225,9 @@ __webpack_require__.r(__webpack_exports__);
16189
16225
 
16190
16226
  scheduler._obj.appendChild(t);
16191
16227
 
16192
- t.onclick = function () {
16228
+ scheduler.event(t, "click", function () {
16193
16229
  if (!scheduler.expanded) scheduler.expand();else scheduler.collapse();
16194
- };
16230
+ });
16195
16231
  });
16196
16232
 
16197
16233
  scheduler._maximize = function () {
@@ -20066,17 +20102,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
20066
20102
 
20067
20103
  this._editor = d2.firstChild;
20068
20104
 
20069
- this._editor.onkeypress = function (e) {
20105
+ this._editor.addEventListener("keypress", function (e) {
20070
20106
  if (e.shiftKey) return true;
20071
20107
  var code = e.keyCode;
20072
20108
  if (code == scheduler.keys.edit_save) scheduler.editStop(true);
20073
20109
  if (code == scheduler.keys.edit_cancel) scheduler.editStop(false);
20074
- };
20110
+ });
20075
20111
 
20076
- this._editor.onselectstart = function (e) {
20112
+ this._editor.addEventListener("selectstart", function (e) {
20077
20113
  e.cancelBubble = true;
20078
20114
  return true;
20079
- };
20115
+ });
20080
20116
 
20081
20117
  d2.firstChild.focus(); //IE and opera can add x-scroll during focusing
20082
20118
 
@@ -21870,6 +21906,8 @@ __webpack_require__.r(__webpack_exports__);
21870
21906
  "use strict";
21871
21907
  __webpack_require__.r(__webpack_exports__);
21872
21908
  /* harmony default export */ __webpack_exports__["default"] = (function (scheduler) {
21909
+ var minicalDomEvents = scheduler._createDomEventScope();
21910
+
21873
21911
  scheduler.templates.calendar_month = scheduler.date.date_to_str("%F %Y");
21874
21912
  scheduler.templates.calendar_scale_date = scheduler.date.date_to_str("%D");
21875
21913
  scheduler.templates.calendar_date = scheduler.date.date_to_str("%d");
@@ -21902,22 +21940,25 @@ __webpack_require__.r(__webpack_exports__);
21902
21940
  if (!cont) cont = scheduler._get_def_cont(pos);
21903
21941
  cal = this._render_calendar(cont, date, obj);
21904
21942
 
21905
- cal.onclick = function (e) {
21906
- var src = e.target || e.srcElement;
21907
- var $dom = scheduler.$domHelpers;
21908
-
21909
- if ($dom.closest(src, ".dhx_month_head")) {
21910
- if (!$dom.closest(src, ".dhx_after") && !$dom.closest(src, ".dhx_before")) {
21911
- var cellRoot = $dom.closest(src, "[data-cell-date]");
21912
- var dateAttribute = cellRoot.getAttribute("data-cell-date");
21913
- var newDate = scheduler.templates.parse_date(dateAttribute);
21914
- scheduler.unmarkCalendar(this);
21915
- scheduler.markCalendar(this, newDate, "dhx_calendar_click");
21916
- this._last_date = newDate;
21917
- if (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);
21943
+ if (!cal.$_eventAttached) {
21944
+ cal.$_eventAttached = true;
21945
+ minicalDomEvents.attach(cal, "click", function (e) {
21946
+ var src = e.target || e.srcElement;
21947
+ var $dom = scheduler.$domHelpers;
21948
+
21949
+ if ($dom.closest(src, ".dhx_month_head")) {
21950
+ if (!$dom.closest(src, ".dhx_after") && !$dom.closest(src, ".dhx_before")) {
21951
+ var cellRoot = $dom.closest(src, "[data-cell-date]");
21952
+ var dateAttribute = cellRoot.getAttribute("data-cell-date");
21953
+ var newDate = scheduler.templates.parse_date(dateAttribute);
21954
+ scheduler.unmarkCalendar(this);
21955
+ scheduler.markCalendar(this, newDate, "dhx_calendar_click");
21956
+ this._last_date = newDate;
21957
+ if (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);
21958
+ }
21918
21959
  }
21919
- }
21920
- };
21960
+ }.bind(cal));
21961
+ }
21921
21962
  } else {
21922
21963
  cal = this._render_calendar(_prev.parentNode, date, obj, _prev);
21923
21964
  scheduler.unmarkCalendar(cal);
@@ -21971,11 +22012,9 @@ __webpack_require__.r(__webpack_exports__);
21971
22012
  if (!this._def_count) {
21972
22013
  this._def_count = document.createElement("div");
21973
22014
  this._def_count.className = "dhx_minical_popup";
21974
-
21975
- this._def_count.onclick = function (e) {
22015
+ scheduler.event(this._def_count, "click", function (e) {
21976
22016
  e.cancelBubble = true;
21977
- };
21978
-
22017
+ });
21979
22018
  document.body.appendChild(this._def_count);
21980
22019
  }
21981
22020
 
@@ -22143,7 +22182,7 @@ __webpack_require__.r(__webpack_exports__);
22143
22182
  arrow.style.cssText = css_texts[j];
22144
22183
  arrow.innerHTML = this._mini_cal_arrows[j];
22145
22184
  header.appendChild(arrow);
22146
- arrow.onclick = handler(diffs[j]);
22185
+ minicalDomEvents.attach(arrow, "click", handler(diffs[j]));
22147
22186
  }
22148
22187
  }
22149
22188
 
@@ -22201,7 +22240,8 @@ __webpack_require__.r(__webpack_exports__);
22201
22240
  }
22202
22241
 
22203
22242
  if (!cal) return;
22204
- cal.onclick = null;
22243
+ minicalDomEvents.detachAll(); //cal.onclick = null;
22244
+
22205
22245
  cal.innerHTML = "";
22206
22246
  if (cal.parentNode) cal.parentNode.removeChild(cal);
22207
22247
  if (this._def_count) this._def_count.style.top = "-1000px";
@@ -22213,16 +22253,12 @@ __webpack_require__.r(__webpack_exports__);
22213
22253
  return false;
22214
22254
  };
22215
22255
 
22216
- scheduler._attach_minical_events = function () {
22256
+ scheduler.attachEvent("onTemplatesReady", function () {
22217
22257
  scheduler.event(document.body, "click", function () {
22218
22258
  scheduler.destroyCalendar();
22219
22259
  });
22220
-
22221
- scheduler._attach_minical_events = function () {};
22222
- };
22223
-
22224
- scheduler.attachEvent("onTemplatesReady", function () {
22225
- scheduler._attach_minical_events();
22260
+ }, {
22261
+ once: true
22226
22262
  });
22227
22263
  scheduler.templates.calendar_time = scheduler.date.date_to_str("%d-%m-%Y");
22228
22264
  scheduler.form_blocks.calendar_time = {
@@ -22262,7 +22298,7 @@ __webpack_require__.r(__webpack_exports__);
22262
22298
  var start_date, end_date;
22263
22299
 
22264
22300
  var _init_once = function _init_once(inp, date, number) {
22265
- inp.onclick = function () {
22301
+ scheduler.event(inp, "click", function () {
22266
22302
  scheduler.destroyCalendar(null, true);
22267
22303
  scheduler.renderCalendar({
22268
22304
  position: inp,
@@ -22279,7 +22315,7 @@ __webpack_require__.r(__webpack_exports__);
22279
22315
  }
22280
22316
  }
22281
22317
  });
22282
- };
22318
+ });
22283
22319
  };
22284
22320
 
22285
22321
  if (scheduler.config.full_day) {
@@ -22296,27 +22332,30 @@ __webpack_require__.r(__webpack_exports__);
22296
22332
  selects[0].disabled = input.checked;
22297
22333
  selects[1].disabled = input.checked;
22298
22334
 
22299
- input.onclick = function () {
22300
- if (input.checked === true) {
22301
- var obj = {};
22302
- scheduler.form_blocks.calendar_time.get_value(node, obj);
22303
- start_date = scheduler.date.date_part(obj.start_date);
22304
- end_date = scheduler.date.date_part(obj.end_date);
22305
- if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) end_date = scheduler.date.add(end_date, 1, "day");
22306
- }
22335
+ if (!input.$_eventAttached) {
22336
+ input.$_eventAttached = true;
22337
+ scheduler.event(input, "click", function () {
22338
+ if (input.checked === true) {
22339
+ var obj = {};
22340
+ scheduler.form_blocks.calendar_time.get_value(node, obj);
22341
+ start_date = scheduler.date.date_part(obj.start_date);
22342
+ end_date = scheduler.date.date_part(obj.end_date);
22343
+ if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) end_date = scheduler.date.add(end_date, 1, "day");
22344
+ }
22307
22345
 
22308
- var start = start_date || ev.start_date;
22309
- var end = end_date || ev.end_date;
22346
+ var start = start_date || ev.start_date;
22347
+ var end = end_date || ev.end_date;
22310
22348
 
22311
- _attach_action(inputs[0], start);
22349
+ _attach_action(inputs[0], start);
22312
22350
 
22313
- _attach_action(inputs[1], end);
22351
+ _attach_action(inputs[1], end);
22314
22352
 
22315
- selects[0].value = start.getHours() * 60 + start.getMinutes();
22316
- selects[1].value = end.getHours() * 60 + end.getMinutes();
22317
- selects[0].disabled = input.checked;
22318
- selects[1].disabled = input.checked;
22319
- };
22353
+ selects[0].value = start.getHours() * 60 + start.getMinutes();
22354
+ selects[1].value = end.getHours() * 60 + end.getMinutes();
22355
+ selects[0].disabled = input.checked;
22356
+ selects[1].disabled = input.checked;
22357
+ });
22358
+ }
22320
22359
  }
22321
22360
 
22322
22361
  if (scheduler.config.event_duration && scheduler.config.auto_end_date) {
@@ -22333,7 +22372,9 @@ __webpack_require__.r(__webpack_exports__);
22333
22372
  selects[1].value = end_date.getHours() * 60 + end_date.getMinutes();
22334
22373
  };
22335
22374
 
22336
- selects[0].onchange = _update_minical_select; // only update on first select should trigger update so user could define other end date if he wishes too
22375
+ if (!selects[0].$_eventAttached) {
22376
+ selects[0].addEventListener("change", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too
22377
+ }
22337
22378
  }
22338
22379
 
22339
22380
  function _attach_action(inp, date, number) {
@@ -22437,6 +22478,9 @@ __webpack_require__.r(__webpack_exports__);
22437
22478
  scheduler.attachEvent("onEventCancel", function () {
22438
22479
  scheduler.destroyCalendar(null, true);
22439
22480
  });
22481
+ scheduler.attachEvent("onDestroy", function () {
22482
+ scheduler.destroyCalendar();
22483
+ });
22440
22484
  });
22441
22485
 
22442
22486
  /***/ }),
@@ -23186,6 +23230,10 @@ __webpack_require__.r(__webpack_exports__);
23186
23230
  scheduler.config.show_quick_info = true;
23187
23231
  scheduler.xy.menu_width = 0;
23188
23232
  scheduler.attachEvent("onClick", function (id) {
23233
+ if (!scheduler.config.show_quick_info) {
23234
+ return;
23235
+ }
23236
+
23189
23237
  scheduler.showQuickInfo(id);
23190
23238
  return true;
23191
23239
  });
@@ -23226,9 +23274,13 @@ __webpack_require__.r(__webpack_exports__);
23226
23274
  };
23227
23275
 
23228
23276
  scheduler.showQuickInfo = function (id) {
23229
- if (id == this._quick_info_box_id || !this.config.show_quick_info) return;
23277
+ if (id == this._quick_info_box_id) return;
23230
23278
  this.hideQuickInfo(true);
23231
23279
 
23280
+ if (this.callEvent("onBeforeQuickInfo", [id]) === false) {
23281
+ return;
23282
+ }
23283
+
23232
23284
  var pos = this._get_event_counter_part(id);
23233
23285
 
23234
23286
  if (pos) {
@@ -23615,50 +23667,11 @@ __webpack_require__.r(__webpack_exports__);
23615
23667
  olds.call(this, n);
23616
23668
  if (scheduler._lightbox) scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);
23617
23669
  this._lightbox = n;
23618
- if (scheduler.config.drag_lightbox) n.firstChild.onmousedown = scheduler._ready_to_dnd;
23619
- this.setLightboxSize();
23620
-
23621
- n.onclick = function (e) {
23622
- var src = e.target;
23623
- var buttonElement = scheduler.$domHelpers.closest(src, ".dhx_btn_set");
23624
-
23625
- if (buttonElement) {
23626
- if (buttonElement.querySelector(".dhx_cancel_btn")) {
23627
- scheduler.cancel_lightbox();
23628
- }
23629
- }
23630
- };
23670
+ if (scheduler.config.drag_lightbox) scheduler.event(n.firstChild, "mousedown", scheduler._ready_to_dnd);
23631
23671
 
23632
- n.onkeydown = function (e) {
23633
- var event = e;
23634
- var target = e.target || e.srcElement;
23635
- var buttonTarget = target.querySelector("[dhx_button]");
23672
+ scheduler._init_lightbox_events();
23636
23673
 
23637
- if (!buttonTarget) {
23638
- buttonTarget = target.parentNode.querySelector(".dhx_custom_button, .dhx_readonly");
23639
- }
23640
-
23641
- switch ((e || event).keyCode) {
23642
- case 32:
23643
- {
23644
- //space
23645
- if ((e || event).shiftKey) return;
23646
-
23647
- if (buttonTarget && buttonTarget.click) {
23648
- buttonTarget.click();
23649
- }
23650
-
23651
- break;
23652
- }
23653
-
23654
- case scheduler.keys.edit_cancel:
23655
- scheduler.cancel_lightbox();
23656
- break;
23657
-
23658
- default:
23659
- break;
23660
- }
23661
- };
23674
+ this.setLightboxSize();
23662
23675
  }
23663
23676
 
23664
23677
  return res;
@@ -23796,7 +23809,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
23796
23809
  start: ev.start_date,
23797
23810
  end: ev._end_date
23798
23811
  };
23799
- var str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date);
23812
+ var str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);
23800
23813
 
23801
23814
  var str_date = function str_date(_str_date) {
23802
23815
  var date = str_date_format(_str_date);
@@ -24123,10 +24136,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
24123
24136
 
24124
24137
  var node = scheduler.form_blocks["recurring"]._get_form_node(els, "repeat", code[0]);
24125
24138
 
24126
- if (node.nodeName == "SELECT" && node.onchange) {
24127
- node.onchange();
24128
- } else if (node.onclick) {
24129
- node.onclick();
24139
+ if (node.nodeName == "SELECT"
24140
+ /* && node.onchange*/
24141
+ ) {
24142
+ // node.onchange();
24143
+ node.dispatchEvent(new Event('change'));
24144
+ node.dispatchEvent(new MouseEvent('click'));
24145
+ } else {
24146
+ node.dispatchEvent(new MouseEvent('click'));
24130
24147
  }
24131
24148
  }
24132
24149
 
@@ -24137,10 +24154,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
24137
24154
 
24138
24155
  switch (el.name) {
24139
24156
  case "repeat":
24140
- if (el.nodeName == "SELECT") {
24141
- el.onchange = change_current_view;
24142
- } else {
24143
- el.onclick = change_current_view;
24157
+ if (el.nodeName == "SELECT" && !el.$_eventAttached) {
24158
+ el.$_eventAttached = true;
24159
+ el.addEventListener("change", change_current_view);
24160
+ } else if (!el.$_eventAttached) {
24161
+ el.$_eventAttached = true;
24162
+ el.addEventListener("click", change_current_view);
24144
24163
  }
24145
24164
 
24146
24165
  break;
@@ -24233,7 +24252,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
24233
24252
  scheduler.setLightboxSize();
24234
24253
  },
24235
24254
  focus: function focus(node) {},
24236
- button_click: function button_click(index, el, section, cont) {
24255
+ button_click: function button_click(node, button, event) {
24237
24256
  var block = scheduler.form_blocks.recurring;
24238
24257
 
24239
24258
  var cont = block._get_form();
@@ -25208,6 +25227,8 @@ __webpack_require__.r(__webpack_exports__);
25208
25227
  "use strict";
25209
25228
  __webpack_require__.r(__webpack_exports__);
25210
25229
  /* harmony default export */ __webpack_exports__["default"] = (function (scheduler) {
25230
+ var tooltipEventScope = scheduler._createDomEventScope();
25231
+
25211
25232
  var dhtmlXTooltip = {};
25212
25233
  scheduler.ext.tooltip = scheduler.dhtmlXTooltip = scheduler.tooltip = dhtmlXTooltip;
25213
25234
  dhtmlXTooltip.config = {
@@ -25227,7 +25248,7 @@ __webpack_require__.r(__webpack_exports__);
25227
25248
  if (this._mobile && !scheduler.config.touch_tooltip) return;
25228
25249
  var dhxTooltip = dhtmlXTooltip;
25229
25250
  var tooltip_div = this.tooltip;
25230
- var tooltip_div_style = tooltip_div.style;
25251
+ var tooltipStyle = tooltip_div.style;
25231
25252
  dhxTooltip.tooltip.className = dhxTooltip.config.className;
25232
25253
  var pos = this.position(event);
25233
25254
  var target = event.target || event.srcElement; // if we are over tooltip -- do nothing, just return (so tooltip won't move)
@@ -25238,18 +25259,11 @@ __webpack_require__.r(__webpack_exports__);
25238
25259
 
25239
25260
  var actual_x = pos.x + (dhxTooltip.config.delta_x || 0);
25240
25261
  var actual_y = pos.y - (dhxTooltip.config.delta_y || 0);
25241
- tooltip_div_style.visibility = "hidden";
25242
-
25243
- if (tooltip_div_style.removeAttribute) {
25244
- tooltip_div_style.removeAttribute("right");
25245
- tooltip_div_style.removeAttribute("bottom");
25246
- } else {
25247
- tooltip_div_style.removeProperty("right");
25248
- tooltip_div_style.removeProperty("bottom");
25249
- }
25250
-
25251
- tooltip_div_style.left = "0";
25252
- tooltip_div_style.top = "0";
25262
+ tooltipStyle.visibility = "hidden";
25263
+ tooltipStyle.right = "";
25264
+ tooltipStyle.bottom = "";
25265
+ tooltipStyle.left = "0";
25266
+ tooltipStyle.top = "0";
25253
25267
 
25254
25268
  if (scheduler.config.rtl) {
25255
25269
  tooltip_div.className += " dhtmlXTooltip_rtl";
@@ -25262,37 +25276,44 @@ __webpack_require__.r(__webpack_exports__);
25262
25276
 
25263
25277
  if (document.documentElement.clientWidth - actual_x - tooltip_width < 0) {
25264
25278
  // tooltip is out of the right page bound
25265
- if (tooltip_div_style.removeAttribute) tooltip_div_style.removeAttribute("left");else tooltip_div_style.removeProperty("left");
25266
- tooltip_div_style.right = document.documentElement.clientWidth - actual_x + 2 * (dhxTooltip.config.delta_x || 0) + "px";
25279
+ tooltipStyle.left = "";
25280
+ tooltipStyle.right = document.documentElement.clientWidth - actual_x + 2 * (dhxTooltip.config.delta_x || 0) + "px";
25267
25281
  } else {
25268
25282
  if (actual_x < 0) {
25269
25283
  // tooltips is out of the left page bound
25270
- tooltip_div_style.left = pos.x + Math.abs(dhxTooltip.config.delta_x || 0) + "px";
25284
+ tooltipStyle.left = pos.x + Math.abs(dhxTooltip.config.delta_x || 0) + "px";
25271
25285
  } else {
25272
25286
  // normal situation
25273
- tooltip_div_style.left = actual_x + "px";
25287
+ tooltipStyle.left = actual_x + "px";
25274
25288
  }
25275
25289
  }
25276
25290
 
25277
25291
  if (document.documentElement.clientHeight - actual_y - tooltip_height < 0) {
25278
25292
  // tooltip is below bottom of the page
25279
- if (tooltip_div_style.removeAttribute) tooltip_div_style.removeAttribute("top");else tooltip_div_style.removeProperty("top");
25280
- tooltip_div_style.bottom = document.documentElement.clientHeight - actual_y - 2 * (dhxTooltip.config.delta_y || 0) + "px";
25293
+ var bottom = document.documentElement.clientHeight - actual_y - 2 * (dhxTooltip.config.delta_y || 0);
25294
+
25295
+ if (bottom + tooltip_height > document.documentElement.clientHeight) {
25296
+ actual_y -= Math.abs(document.documentElement.clientHeight - actual_y - tooltip_height);
25297
+ actual_y = Math.max(actual_y, 0);
25298
+ tooltipStyle.top = actual_y + "px";
25299
+ } else {
25300
+ tooltipStyle.bottom = bottom + "px";
25301
+ tooltipStyle.top = "";
25302
+ }
25281
25303
  } else {
25282
25304
  if (actual_y < 0) {
25283
25305
  // tooltip is higher then top of the page
25284
- tooltip_div_style.top = pos.y + Math.abs(dhxTooltip.config.delta_y || 0) + "px";
25306
+ tooltipStyle.top = pos.y + Math.abs(dhxTooltip.config.delta_y || 0) + "px";
25285
25307
  } else {
25286
25308
  // normal situation
25287
- tooltip_div_style.top = actual_y + "px";
25309
+ tooltipStyle.top = actual_y + "px";
25288
25310
  }
25289
25311
  }
25290
25312
 
25291
25313
  scheduler._waiAria.tooltipVisibleAttr(this.tooltip);
25292
25314
 
25293
- tooltip_div_style.visibility = "visible";
25294
-
25295
- this.tooltip.onmouseleave = function (e) {
25315
+ tooltipStyle.visibility = "visible";
25316
+ tooltipEventScope.attach(this.tooltip, "mouseleave", function (e) {
25296
25317
  /*
25297
25318
  A rare but reported scenario, when tooltip appears at the edge of the scheduler (e.g. left part inside cal, right part - outside).
25298
25319
  User moves mouse from the scheduler into the tooltip, and then from the tooltip to the page outside the calendar.
@@ -25306,8 +25327,7 @@ __webpack_require__.r(__webpack_exports__);
25306
25327
  }
25307
25328
 
25308
25329
  if (node != scheduler._obj) tooltip.delay(tooltip.hide, tooltip, [], tooltip.config.timeout_to_hide);
25309
- };
25310
-
25330
+ });
25311
25331
  scheduler.callEvent("onTooltipDisplayed", [this.tooltip, this.tooltip.event_id]);
25312
25332
  };
25313
25333
 
@@ -25322,8 +25342,9 @@ __webpack_require__.r(__webpack_exports__);
25322
25342
  scheduler._waiAria.tooltipHiddenAttr(this.tooltip);
25323
25343
 
25324
25344
  var event_id = this.tooltip.event_id;
25325
- this.tooltip.event_id = null;
25326
- this.tooltip.onmouseleave = null;
25345
+ this.tooltip.event_id = null; //this.tooltip.onmouseleave = null;
25346
+
25347
+ tooltipEventScope.detachAll();
25327
25348
  this.tooltip.parentNode.removeChild(this.tooltip);
25328
25349
  scheduler.callEvent("onAfterTooltip", [event_id]);
25329
25350
  }
@@ -25413,6 +25434,9 @@ __webpack_require__.r(__webpack_exports__);
25413
25434
  dhtmlXTooltip.hide();
25414
25435
  return true;
25415
25436
  });
25437
+ scheduler.attachEvent("onDestroy", function () {
25438
+ dhtmlXTooltip.hide();
25439
+ });
25416
25440
  });
25417
25441
 
25418
25442
  /***/ }),
@@ -25593,8 +25617,6 @@ __webpack_require__.r(__webpack_exports__);
25593
25617
  };
25594
25618
 
25595
25619
  var old = scheduler.render_data;
25596
- var to_attr = scheduler.date.date_to_str("%Y/%m/%d");
25597
- var from_attr = scheduler.date.str_to_date("%Y/%m/%d");
25598
25620
 
25599
25621
  scheduler.render_data = function (evs) {
25600
25622
  if (!is_year_mode()) return old.apply(this, arguments);
@@ -25638,7 +25660,7 @@ __webpack_require__.r(__webpack_exports__);
25638
25660
  t.className = "dhx_year_tooltip";
25639
25661
  if (this.config.rtl) t.className += " dhx_tooltip_rtl";
25640
25662
  document.body.appendChild(t);
25641
- t.onclick = scheduler._click.dhx_cal_data;
25663
+ t.addEventListener("click", scheduler._click.dhx_cal_data);
25642
25664
  }
25643
25665
 
25644
25666
  var evs = this.getEvents(date, this.date.add(date, 1, "day"));
@@ -25668,7 +25690,7 @@ __webpack_require__.r(__webpack_exports__);
25668
25690
  var src = e.target || e.srcElement;
25669
25691
  if (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)
25670
25692
  src = src.parentNode;
25671
- if (scheduler._getClassName(src).indexOf("dhx_year_event") != -1) scheduler._showToolTip(from_attr(src.getAttribute("date")), scheduler.$domHelpers.getOffset(src), e, src);else scheduler._hideToolTip();
25693
+ if (scheduler._getClassName(src).indexOf("dhx_year_event") != -1) scheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute("date-year-date")), scheduler.$domHelpers.getOffset(src), e, src);else scheduler._hideToolTip();
25672
25694
  };
25673
25695
 
25674
25696
  scheduler._init_year_tooltip = function () {
@@ -25692,7 +25714,7 @@ __webpack_require__.r(__webpack_exports__);
25692
25714
  scheduler._year_marked_cells = {};
25693
25715
 
25694
25716
  scheduler._mark_year_date = function (date, event) {
25695
- var dateString = to_attr(date);
25717
+ var dateString = scheduler.templates.format_date(date);
25696
25718
 
25697
25719
  var cell = this._get_year_cell(date);
25698
25720
 
@@ -25704,7 +25726,7 @@ __webpack_require__.r(__webpack_exports__);
25704
25726
 
25705
25727
  if (!scheduler._year_marked_cells[dateString]) {
25706
25728
  cell.className = "dhx_month_head dhx_year_event";
25707
- cell.setAttribute("date", dateString);
25729
+ cell.setAttribute("date-year-date", dateString);
25708
25730
  scheduler._year_marked_cells[dateString] = cell;
25709
25731
  }
25710
25732
 
@@ -25923,13 +25945,13 @@ __webpack_require__.r(__webpack_exports__);
25923
25945
  var node = scheduler._get_year_el_node(node, scheduler._locate_year_month_root);
25924
25946
 
25925
25947
  if (!node) return null;
25926
- var date = node.getAttribute("date");
25948
+ var date = node.getAttribute("date-year-date");
25927
25949
  if (!date) return null;
25928
- return scheduler.date.week_start(scheduler.date.month_start(from_attr(date)));
25950
+ return scheduler.date.week_start(scheduler.date.month_start(scheduler.templates.parse_date(date)));
25929
25951
  };
25930
25952
 
25931
25953
  scheduler._locate_year_month_day = function (n) {
25932
- return scheduler._getClassName(n).indexOf("dhx_year_event") != -1 && n.hasAttribute && n.hasAttribute("date");
25954
+ return scheduler._getClassName(n).indexOf("dhx_year_event") != -1 && n.hasAttribute && n.hasAttribute("date-year-date");
25933
25955
  };
25934
25956
 
25935
25957
  var locateEvent = scheduler._locate_event;
@@ -25940,8 +25962,8 @@ __webpack_require__.r(__webpack_exports__);
25940
25962
  if (!id) {
25941
25963
  var day = scheduler._get_year_el_node(node, scheduler._locate_year_month_day);
25942
25964
 
25943
- if (!day || !day.hasAttribute("date")) return null;
25944
- var dat = from_attr(day.getAttribute("date"));
25965
+ if (!day || !day.hasAttribute("date-year-date")) return null;
25966
+ var dat = scheduler.templates.parse_date(day.getAttribute("date-year-date"));
25945
25967
  var evs = scheduler.getEvents(dat, scheduler.date.add(dat, 1, "day"));
25946
25968
  if (!evs.length) return null; //can be multiple events in the cell, return any single one
25947
25969
 
@@ -25960,7 +25982,7 @@ __webpack_require__.r(__webpack_exports__);
25960
25982
  };
25961
25983
 
25962
25984
  scheduler._locate_year_month_root = function (n) {
25963
- return n.hasAttribute && n.hasAttribute("date");
25985
+ return n.hasAttribute && n.hasAttribute("date-year-date");
25964
25986
  };
25965
25987
 
25966
25988
  scheduler._get_year_month_cell = function (node) {
@@ -25982,6 +26004,10 @@ __webpack_require__.r(__webpack_exports__);
25982
26004
 
25983
26005
  return node;
25984
26006
  };
26007
+
26008
+ scheduler.attachEvent("onDestroy", function () {
26009
+ scheduler._hideToolTip();
26010
+ });
25985
26011
  });
25986
26012
 
25987
26013
  /***/ }),
@@ -29191,11 +29217,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
29191
29217
 
29192
29218
  /* harmony default export */ __webpack_exports__["default"] = (function (extensionManager) {
29193
29219
  var scheduler = {
29194
- version: "6.0.0"
29220
+ version: "6.0.1"
29195
29221
  };
29196
29222
  Object(_core_common_errors__WEBPACK_IMPORTED_MODULE_2__["default"])(scheduler);
29197
- Object(_core_scheduler__WEBPACK_IMPORTED_MODULE_4__["default"])(scheduler);
29198
29223
  Object(_core_common__WEBPACK_IMPORTED_MODULE_5__["default"])(scheduler);
29224
+ Object(_core_scheduler__WEBPACK_IMPORTED_MODULE_4__["default"])(scheduler);
29199
29225
  Object(_core_wai_aria__WEBPACK_IMPORTED_MODULE_6__["default"])(scheduler); //utils(scheduler);
29200
29226
 
29201
29227
  scheduler.utils = _core_utils_utils__WEBPACK_IMPORTED_MODULE_7__["default"];