OLD | NEW |
1 (function() { | 1 (function() { |
2 | 2 |
3 var IOS = navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/); | 3 var IOS = navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/); |
4 var IOS_TOUCH_SCROLLING = IOS && IOS[1] >= 8; | 4 var IOS_TOUCH_SCROLLING = IOS && IOS[1] >= 8; |
5 var DEFAULT_PHYSICAL_COUNT = 3; | 5 var DEFAULT_PHYSICAL_COUNT = 3; |
6 var HIDDEN_Y = '-10000px'; | 6 var HIDDEN_Y = '-10000px'; |
7 var ITEM_WIDTH = 0; | 7 var ITEM_WIDTH = 0; |
8 var ITEM_HEIGHT = 1; | 8 var ITEM_HEIGHT = 1; |
9 var SECRET_TABINDEX = -100; | 9 var SECRET_TABINDEX = -100; |
10 | 10 |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 }, | 1459 }, |
1460 | 1460 |
1461 _isIndexVisible: function(idx) { | 1461 _isIndexVisible: function(idx) { |
1462 return idx >= this.firstVisibleIndex && idx <= this.lastVisibleIndex; | 1462 return idx >= this.firstVisibleIndex && idx <= this.lastVisibleIndex; |
1463 }, | 1463 }, |
1464 | 1464 |
1465 _getPhysicalIndex: function(idx) { | 1465 _getPhysicalIndex: function(idx) { |
1466 return this._physicalIndexForKey[this._collection.getKey(this._getNormaliz
edItem(idx))]; | 1466 return this._physicalIndexForKey[this._collection.getKey(this._getNormaliz
edItem(idx))]; |
1467 }, | 1467 }, |
1468 | 1468 |
| 1469 focusItem: function(idx) { |
| 1470 this._focusPhysicalItem(idx); |
| 1471 }, |
| 1472 |
1469 _focusPhysicalItem: function(idx) { | 1473 _focusPhysicalItem: function(idx) { |
1470 if (idx < 0 || idx >= this._virtualCount) { | 1474 if (idx < 0 || idx >= this._virtualCount) { |
1471 return; | 1475 return; |
1472 } | 1476 } |
1473 this._restoreFocusedItem(); | 1477 this._restoreFocusedItem(); |
1474 // scroll to index to make sure it's rendered | 1478 // scroll to index to make sure it's rendered |
1475 if (!this._isIndexRendered(idx)) { | 1479 if (!this._isIndexRendered(idx)) { |
1476 this.scrollToIndex(idx); | 1480 this.scrollToIndex(idx); |
1477 } | 1481 } |
1478 | 1482 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 this._focusPhysicalItem(this._focusedIndex + 1); | 1605 this._focusPhysicalItem(this._focusedIndex + 1); |
1602 }, | 1606 }, |
1603 | 1607 |
1604 _didEnter: function(e) { | 1608 _didEnter: function(e) { |
1605 this._focusPhysicalItem(this._focusedIndex); | 1609 this._focusPhysicalItem(this._focusedIndex); |
1606 this._selectionHandler(e.detail.keyboardEvent); | 1610 this._selectionHandler(e.detail.keyboardEvent); |
1607 } | 1611 } |
1608 }); | 1612 }); |
1609 | 1613 |
1610 })(); | 1614 })(); |
OLD | NEW |