Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js

Issue 2885723002: [MD Bookmarks] Add keyboard navigation and selection to bookmark list. (Closed)
Patch Set: address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/polymer/v1_0/chromium.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 })();
OLDNEW
« no previous file with comments | « third_party/polymer/v1_0/chromium.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698