Chromium Code Reviews| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 clear: !e.ctrlKey, | 170 clear: !e.ctrlKey, |
| 171 range: e.shiftKey, | 171 range: e.shiftKey, |
| 172 toggle: false, | 172 toggle: false, |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 this.dispatch(bookmarks.actions.selectItem( | 175 this.dispatch(bookmarks.actions.selectItem( |
| 176 this.displayedIds_[focusedIndex], this.getState(), config)); | 176 this.displayedIds_[focusedIndex], this.getState(), config)); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Prevent the iron-list from changing focus on enter. | |
| 181 if (e.path[0] instanceof HTMLButtonElement && e.key == 'Enter') { | |
|
calamity
2017/06/06 07:15:11
🤡🎪
Remove braces.
Might be worth writing a test
tsergeant
2017/06/06 08:10:48
Done.
| |
| 182 handled = true; | |
| 183 } | |
| 184 | |
| 185 if (!handled) { | |
| 186 handled = bookmarks.CommandManager.getInstance().handleKeyEvent( | |
| 187 e, this.getState().selection.items); | |
| 188 } | |
| 189 | |
| 180 if (handled) | 190 if (handled) |
| 181 e.stopPropagation(); | 191 e.stopPropagation(); |
| 182 }, | 192 }, |
| 183 }); | 193 }); |
| OLD | NEW |