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

Function header_cell

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

Source from the content-addressed store, hash-verified

11300 } });
11301}
11302function header_cell(scheduler2) {
11303 scheduler2.$keyboardNavigation.HeaderCell = function(index) {
11304 this.index = index || 0;
11305 };
11306 scheduler2.$keyboardNavigation.HeaderCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) {
11307 index = index || this.index || 0;
11308 var nodes = this.getNodes();
11309 if (nodes[index])
11310 return nodes[index];
11311 }, getNodes: function(selector) {
11312 selector = selector || [".dhx_cal_navline .dhx_cal_prev_button", ".dhx_cal_navline .dhx_cal_next_button", ".dhx_cal_navline .dhx_cal_today_button", ".dhx_cal_navline .dhx_cal_tab"].join(", ");
11313 var nodes = Array.prototype.slice.call(scheduler2.$container.querySelectorAll(selector));
11314 nodes.sort(function(a, b) {
11315 return a.offsetLeft - b.offsetLeft;
11316 });
11317 return nodes;
11318 }, _handlers: null, isValid: function() {
11319 return !!this.getNode(this.index);
11320 }, fallback: function() {
11321 var defaultCell = this.getNode(0);
11322 if (!defaultCell) {
11323 defaultCell = new scheduler2.$keyboardNavigation.TimeSlot();
11324 }
11325 return defaultCell;
11326 }, keys: { left: function() {
11327 var newIndex = this.index - 1;
11328 if (newIndex < 0) {
11329 newIndex = this.getNodes().length - 1;
11330 }
11331 this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex));
11332 }, right: function() {
11333 var newIndex = this.index + 1;
11334 if (newIndex >= this.getNodes().length) {
11335 newIndex = 0;
11336 }
11337 this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex));
11338 }, down: function() {
11339 this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot());
11340 }, enter: function() {
11341 var node = this.getNode();
11342 if (node) {
11343 node.click();
11344 }
11345 } } });
11346 scheduler2.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler2.$keyboardNavigation.HeaderCell.prototype.keys);
11347}
11348function event(scheduler2) {
11349 scheduler2.$keyboardNavigation.Event = function(id) {
11350 this.eventId = null;

Callers 1

key_navFunction · 0.70

Calls 1

getNodeMethod · 0.45

Tested by

no test coverage detected