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

Function header_cell

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

Source from the content-addressed store, hash-verified

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

Callers 1

key_navFunction · 0.70

Calls 1

getNodeMethod · 0.45

Tested by

no test coverage detected