| Index: chrome/browser/resources/md_history/history_list.js
|
| diff --git a/chrome/browser/resources/md_history/history_list.js b/chrome/browser/resources/md_history/history_list.js
|
| index fad3d1bd205257e43a1b4e967048a7038a92516c..f7239534b48478536ab04610b5061cd587e9753a 100644
|
| --- a/chrome/browser/resources/md_history/history_list.js
|
| +++ b/chrome/browser/resources/md_history/history_list.js
|
| @@ -29,6 +29,7 @@ Polymer({
|
|
|
| listeners: {
|
| 'remove-bookmark-stars': 'removeBookmarkStars_',
|
| + 'open-menu': 'onOpenMenu_',
|
| },
|
|
|
| /** @override */
|
| @@ -105,6 +106,19 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * Ensure that the item is visible in the scroll pane when its menu is
|
| + * opened (it is possible to open off-screen items using keyboard shortcuts).
|
| + * @param {Event} e
|
| + * @private
|
| + */
|
| + onOpenMenu_: function(e) {
|
| + var index = e.detail.index;
|
| + var list = /** @type {IronListElement} */ (this.$['infinite-list']);
|
| + if (index < list.firstVisibleIndex || index > list.lastVisibleIndex)
|
| + list.scrollToIndex(index);
|
| + },
|
| +
|
| + /**
|
| * Check whether the time difference between the given history item and the
|
| * next one is large enough for a spacer to be required.
|
| * @param {HistoryEntry} item
|
|
|