| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 Polymer({ | 5 Polymer({ |
| 6 is: 'bookmarks-list', | 6 is: 'bookmarks-list', |
| 7 | 7 |
| 8 behaviors: [ | 8 behaviors: [ |
| 9 bookmarks.StoreClient, | 9 bookmarks.StoreClient, |
| 10 ], | 10 ], |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 clear: !e.ctrlKey, | 172 clear: !e.ctrlKey, |
| 173 range: e.shiftKey, | 173 range: e.shiftKey, |
| 174 toggle: false, | 174 toggle: false, |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 this.dispatch(bookmarks.actions.selectItem( | 177 this.dispatch(bookmarks.actions.selectItem( |
| 178 this.displayedIds_[focusedIndex], this.getState(), config)); | 178 this.displayedIds_[focusedIndex], this.getState(), config)); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 // Prevent the iron-list from changing focus on enter. |
| 183 if (e.path[0] instanceof HTMLButtonElement && e.key == 'Enter') |
| 184 handled = true; |
| 185 |
| 186 if (!handled) { |
| 187 handled = bookmarks.CommandManager.getInstance().handleKeyEvent( |
| 188 e, this.getState().selection.items); |
| 189 } |
| 190 |
| 182 if (handled) | 191 if (handled) |
| 183 e.stopPropagation(); | 192 e.stopPropagation(); |
| 184 }, | 193 }, |
| 185 }); | 194 }); |
| OLD | NEW |