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

Function minical_button

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

Source from the content-addressed store, hash-verified

12038 scheduler2.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler2.$keyboardNavigation.TimeSlot.prototype.keys);
12039}
12040function minical_button(scheduler2) {
12041 scheduler2.$keyboardNavigation.MinicalButton = function(div, index) {
12042 this.container = div;
12043 this.index = index || 0;
12044 };
12045 scheduler2.$keyboardNavigation.MinicalButton.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() {
12046 var container = this.container;
12047 return !!container.offsetWidth;
12048 }, fallback: function() {
12049 var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot();
12050 if (defaultSlot.isValid()) {
12051 return defaultSlot;
12052 } else {
12053 return new scheduler2.$keyboardNavigation.DataArea();
12054 }
12055 }, focus: function() {
12056 scheduler2.$keyboardNavigation.dispatcher.globalNode.disable();
12057 this.container.removeAttribute("tabindex");
12058 scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
12059 }, blur: function() {
12060 this.container.setAttribute("tabindex", "0");
12061 scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);
12062 }, getNode: function() {
12063 if (!this.index) {
12064 return this.container.querySelector(".dhx_cal_prev_button");
12065 } else {
12066 return this.container.querySelector(".dhx_cal_next_button");
12067 }
12068 }, keys: { right: function(e) {
12069 this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));
12070 }, left: function(e) {
12071 this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));
12072 }, down: function() {
12073 var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, 0, 0);
12074 if (next && !next.isValid()) {
12075 next = next.fallback();
12076 }
12077 this.moveTo(next);
12078 }, enter: function(e) {
12079 this.getNode().click();
12080 } } });
12081 scheduler2.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalButton.prototype.keys);
12082}
12083function minical_cell(scheduler2) {
12084 scheduler2.$keyboardNavigation.MinicalCell = function(div, row, col) {
12085 this.container = div;

Callers 1

key_navFunction · 0.70

Calls 1

getNodeMethod · 0.45

Tested by

no test coverage detected