| 12085 | scheduler2.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalButton.prototype.keys); |
| 12086 | } |
| 12087 | function minical_cell(scheduler2) { |
| 12088 | scheduler2.$keyboardNavigation.MinicalCell = function(div, row, col) { |
| 12089 | this.container = div; |
| 12090 | this.row = row || 0; |
| 12091 | this.col = col || 0; |
| 12092 | }; |
| 12093 | scheduler2.$keyboardNavigation.MinicalCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { |
| 12094 | var grid = this._getGrid(); |
| 12095 | return !!(grid[this.row] && grid[this.row][this.col]); |
| 12096 | }, fallback: function() { |
| 12097 | var row = this.row; |
| 12098 | var col = this.col; |
| 12099 | var grid = this._getGrid(); |
| 12100 | if (!grid[row]) { |
| 12101 | row = 0; |
| 12102 | } |
| 12103 | var dir = true; |
| 12104 | if (row > grid.length / 2) { |
| 12105 | dir = false; |
| 12106 | } |
| 12107 | if (!grid[row]) { |
| 12108 | var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); |
| 12109 | if (defaultSlot.isValid()) { |
| 12110 | return defaultSlot; |
| 12111 | } else { |
| 12112 | return new scheduler2.$keyboardNavigation.DataArea(); |
| 12113 | } |
| 12114 | } |
| 12115 | if (dir) { |
| 12116 | for (var c = col; grid[row] && c < grid[row].length; c++) { |
| 12117 | if (!grid[row][c] && c == grid[row].length - 1) { |
| 12118 | row++; |
| 12119 | col = 0; |
| 12120 | } |
| 12121 | if (grid[row][c]) { |
| 12122 | return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); |
| 12123 | } |
| 12124 | } |
| 12125 | } else { |
| 12126 | for (var c = col; grid[row] && c < grid[row].length; c--) { |
| 12127 | if (!grid[row][c] && !c) { |
| 12128 | row--; |
| 12129 | col = grid[row].length - 1; |
| 12130 | } |
| 12131 | if (grid[row][c]) { |
| 12132 | return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); |
| 12133 | } |
| 12134 | } |
| 12135 | } |
| 12136 | return new scheduler2.$keyboardNavigation.MinicalButton(this.container, 0); |
| 12137 | }, focus: function() { |
| 12138 | scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); |
| 12139 | this.container.removeAttribute("tabindex"); |
| 12140 | scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); |
| 12141 | }, blur: function() { |
| 12142 | this.container.setAttribute("tabindex", "0"); |
| 12143 | scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); |
| 12144 | }, _getNode: function(row, col) { |