(scheduler2)
| 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; |
| 11355 | if (scheduler2.getEvent(id)) { |
| 11356 | var ev = scheduler2.getEvent(id); |
| 11357 | this.start = new Date(ev.start_date); |
| 11358 | this.end = new Date(ev.end_date); |
| 11359 | this.section = this._getSection(ev); |
| 11360 | this.eventId = id; |
| 11361 | } |
| 11362 | }; |
| 11363 | scheduler2.$keyboardNavigation.Event.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _getNodes: function() { |
| 11364 | return Array.prototype.slice.call(scheduler2.$container.querySelectorAll("[" + scheduler2.config.event_attribute + "]")); |
| 11365 | }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { |
| 11366 | return !!(scheduler2.getEvent(this.eventId) && this.getNode()); |
| 11367 | }, fallback: function() { |
| 11368 | var eventNode = this._getNodes()[0]; |
| 11369 | var defaultElement = null; |
| 11370 | if (!eventNode || !scheduler2._locate_event(eventNode)) { |
| 11371 | defaultElement = new scheduler2.$keyboardNavigation.TimeSlot(); |
| 11372 | } else { |
| 11373 | var id = scheduler2._locate_event(eventNode); |
| 11374 | defaultElement = new scheduler2.$keyboardNavigation.Event(id); |
| 11375 | } |
| 11376 | return defaultElement; |
| 11377 | }, isScrolledIntoView: function(el) { |
| 11378 | var eventBox = el.getBoundingClientRect(); |
| 11379 | var viewPort = scheduler2.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); |
| 11380 | if (eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom) { |
| 11381 | return false; |
| 11382 | } |
| 11383 | return true; |
| 11384 | }, getNode: function() { |
| 11385 | var idSelector = "[" + scheduler2.config.event_attribute + "='" + this.eventId + "']"; |
| 11386 | var inlineEditor = scheduler2.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); |
| 11387 | if (inlineEditor) { |
| 11388 | return inlineEditor; |
| 11389 | } else { |
| 11390 | if (scheduler2.isMultisectionEvent && scheduler2.isMultisectionEvent(scheduler2.getEvent(this.eventId))) { |
| 11391 | var nodes = scheduler2.$container.querySelectorAll(idSelector); |
| 11392 | for (var i = 0; i < nodes.length; i++) { |
| 11393 | if (this.isScrolledIntoView(nodes[i])) { |
| 11394 | return nodes[i]; |
| 11395 | } |
| 11396 | } |
| 11397 | return nodes[0]; |
| 11398 | } else { |
| 11399 | return scheduler2.$container.querySelector(idSelector); |
| 11400 | } |
| 11401 | } |
| 11402 | }, focus: function() { |
| 11403 | var event2 = scheduler2.getEvent(this.eventId); |
| 11404 | var calendar = scheduler2.getState(); |
| 11405 | if (event2.start_date.valueOf() > calendar.max_date.valueOf() || event2.end_date.valueOf() <= calendar.min_date.valueOf()) { |
| 11406 | scheduler2.setCurrentView(event2.start_date); |
| 11407 | } |
| 11408 | var node = this.getNode(); |
| 11409 | if (this.isScrolledIntoView(node)) { |
no test coverage detected