MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / core

Function core

codebase/sources/dhtmlxscheduler.js:12347–12446  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

12345 })();
12346 }
12347 function core(scheduler2) {
12348 scheduler2.$keyboardNavigation.dispatcher = { isActive: false, activeNode: null, globalNode: new scheduler2.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(callback) {
12349 var top, left;
12350 var scrollable = scheduler2.$container.querySelector(".dhx_timeline_scrollable_data");
12351 if (!scrollable) {
12352 scrollable = scheduler2.$container.querySelector(".dhx_cal_data");
12353 }
12354 if (scrollable) {
12355 top = scrollable.scrollTop;
12356 left = scrollable.scrollLeft;
12357 }
12358 callback();
12359 if (scrollable) {
12360 scrollable.scrollTop = top;
12361 scrollable.scrollLeft = left;
12362 }
12363 }, enable: function() {
12364 if (!scheduler2.$container) {
12365 return;
12366 }
12367 this.isActive = true;
12368 var self2 = this;
12369 this.keepScrollPosition(function() {
12370 self2.globalNode.enable();
12371 self2.setActiveNode(self2.getActiveNode());
12372 });
12373 }, disable: function() {
12374 this.isActive = false;
12375 this.globalNode.disable();
12376 }, isEnabled: function() {
12377 return !!this.isActive;
12378 }, getDefaultNode: function() {
12379 return this.globalNode.getDefaultNode();
12380 }, setDefaultNode: function() {
12381 this.setActiveNode(this.getDefaultNode());
12382 }, getActiveNode: function() {
12383 var node = this.activeNode;
12384 if (node && !node.isValid()) {
12385 node = node.fallback();
12386 }
12387 return node;
12388 }, focusGlobalNode: function() {
12389 this.blurNode(this.globalNode);
12390 this.focusNode(this.globalNode);
12391 }, setActiveNode: function(el) {
12392 if (!el || !el.isValid())
12393 return;
12394 if (this.activeNode) {
12395 if (this.activeNode.compareTo(el)) {
12396 return;
12397 }
12398 }
12399 if (this.isEnabled()) {
12400 this.blurNode(this.activeNode);
12401 this.activeNode = el;
12402 this.focusNode(this.activeNode);
12403 }
12404 }, focusNode: function(el) {

Callers 1

key_navFunction · 0.70

Calls 4

callbackFunction · 0.70
focusMethod · 0.65
getStateMethod · 0.65
getNodeMethod · 0.45

Tested by

no test coverage detected