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

Function eventhandler

codebase/sources/dhtmlxscheduler.es.js:10735–10778  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

10733 }, junctionChar: ",", combinationChar: "+", commandKeys: { shift: 16, alt: 18, ctrl: 17, meta: true }, specialKeys: { backspace: 8, tab: 9, enter: 13, esc: 27, space: 32, up: 38, down: 40, left: 37, right: 39, home: 36, end: 35, pageup: 33, pagedown: 34, delete: 46, insert: 45, plus: 107, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 } };
10734}
10735function eventhandler(scheduler2) {
10736 scheduler2.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(command) {
10737 if (!this._handlers)
10738 this._handlers = {};
10739 var shortcuts = scheduler2.$keyboardNavigation.shortcuts;
10740 var hash = shortcuts.getHash(command);
10741 return this._handlers[hash];
10742 }, doAction: function(command, e) {
10743 var handler = this.findHandler(command);
10744 if (handler) {
10745 handler.call(this, e);
10746 if (e.preventDefault)
10747 e.preventDefault();
10748 else
10749 e.returnValue = false;
10750 }
10751 }, bind: function(shortcut, handler) {
10752 if (!this._handlers)
10753 this._handlers = {};
10754 var shortcuts = scheduler2.$keyboardNavigation.shortcuts;
10755 var commands = shortcuts.parse(shortcut);
10756 for (var i = 0; i < commands.length; i++) {
10757 this._handlers[shortcuts.getHash(commands[i])] = handler;
10758 }
10759 }, unbind: function(shortcut) {
10760 var shortcuts = scheduler2.$keyboardNavigation.shortcuts;
10761 var commands = shortcuts.parse(shortcut);
10762 for (var i = 0; i < commands.length; i++) {
10763 if (this._handlers[shortcuts.getHash(commands[i])]) {
10764 delete this._handlers[shortcuts.getHash(commands[i])];
10765 }
10766 }
10767 }, bindAll: function(map) {
10768 for (var i in map) {
10769 this.bind(i, map[i]);
10770 }
10771 }, initKeys: function() {
10772 if (!this._handlers)
10773 this._handlers = {};
10774 if (this.keys) {
10775 this.bindAll(this.keys);
10776 }
10777 } };
10778}
10779function trap_modal_focus(scheduler2) {
10780 (function() {
10781 scheduler2.$keyboardNavigation.getFocusableNodes = scheduler2._getFocusableNodes;

Callers 1

key_navFunction · 0.70

Calls 2

parseMethod · 0.65
bindMethod · 0.65

Tested by

no test coverage detected