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

Function ra

codebase/dhtmlxscheduler.es.js:4881–4955  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

4879 }, e._temp_key_scope();
4880}
4881function ra(e) {
4882 e.$keyboardNavigation.attachSchedulerHandlers = function() {
4883 var i, t = e.$keyboardNavigation.dispatcher, n = function(r) {
4884 if (e.config.key_nav)
4885 return t.keyDownHandler(r);
4886 }, s = function() {
4887 t.keepScrollPosition(function() {
4888 t.focusGlobalNode();
4889 });
4890 };
4891 e.attachEvent("onDataRender", function() {
4892 e.config.key_nav && t.isEnabled() && !e.getState().editor_id && (clearTimeout(i), i = setTimeout(function() {
4893 if (e.$destroyed)
4894 return !0;
4895 t.isEnabled() || t.enable(), a();
4896 }));
4897 });
4898 var a = function() {
4899 if (t.isEnabled()) {
4900 var r = t.getActiveNode();
4901 r && (r.isValid() || (r = r.fallback()), !r || r instanceof e.$keyboardNavigation.MinicalButton || r instanceof e.$keyboardNavigation.MinicalCell || t.keepScrollPosition(function() {
4902 r.focus(!0);
4903 }));
4904 }
4905 };
4906 function o(r) {
4907 if (!e.config.key_nav)
4908 return !0;
4909 const d = e.getView();
4910 let l = !1;
4911 if (e.getState().mode === "month")
4912 l = e.$keyboardNavigation.isChildOf(r.target || r.srcElement, e.$container.querySelector(".dhx_cal_month_table"));
4913 else if (d && d.layout === "timeline")
4914 l = e.$keyboardNavigation.isChildOf(r.target || r.srcElement, e.$container.querySelector(".dhx_timeline_data_col"));
4915 else {
4916 const m = e.$container.querySelectorAll(".dhx_scale_holder");
4917 l = Array.from(m).some((g) => g === r.target.parentNode);
4918 }
4919 var h, p = e.getActionData(r);
4920 e._locate_event(r.target || r.srcElement) ? h = new e.$keyboardNavigation.Event(e._locate_event(r.target || r.srcElement)) : l && (h = new e.$keyboardNavigation.TimeSlot(), p.date && l && (h = h.nextSlot(new e.$keyboardNavigation.TimeSlot(p.date, null, p.section)))), h && (t.isEnabled() ? p.date && l && t.delay(function() {
4921 t.setActiveNode(h);
4922 }) : t.activeNode = h);
4923 }
4924 e.attachEvent("onSchedulerReady", function() {
4925 var r = e.$container;
4926 e.eventRemove(document, "keydown", n), e.eventRemove(r, "mousedown", o), e.eventRemove(r, "focus", s), e.config.key_nav ? (e.event(document, "keydown", n), e.event(r, "mousedown", o), e.event(r, "focus", s), r.setAttribute("tabindex", "0")) : r.removeAttribute("tabindex");
4927 });
4928 var _ = e.updateEvent;
4929 e.updateEvent = function(r) {
4930 var d = _.apply(this, arguments);
4931 if (e.config.key_nav && t.isEnabled() && e.getState().select_id == r) {
4932 var l = new e.$keyboardNavigation.Event(r);
4933 e.getState().lightbox_id || function(h) {
4934 if (e.config.key_nav && t.isEnabled()) {
4935 var p = h, m = new e.$keyboardNavigation.Event(p.eventId);
4936 if (!m.isValid()) {
4937 var g = m.start || p.start, c = m.end || p.end, u = m.section || p.section;
4938 (m = new e.$keyboardNavigation.TimeSlot(g, c, u)).isValid() || (m = new e.$keyboardNavigation.TimeSlot());

Callers 1

Calls 6

aFunction · 0.70
attachEventMethod · 0.65
getStateMethod · 0.65
eventRemoveMethod · 0.65
eventMethod · 0.65
getNodeMethod · 0.45

Tested by

no test coverage detected