| OLD | NEW |
| 1 <!-- Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 <!-- Copyright (c) 2014 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 <!-- | 5 <!-- |
| 6 Use to add keyboard shortcuts to your components. The last inserted componen
t | 6 Use to add keyboard shortcuts to your components. The last inserted componen
t |
| 7 will always receive the events (and others will not). This prevents the | 7 will always receive the events (and others will not). This prevents the |
| 8 common bug where you have two listeners and multiple actions are taken for | 8 common bug where you have two listeners and multiple actions are taken for |
| 9 the same keyboard shortcut. | 9 the same keyboard shortcut. |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return instance.isActive() && instance.hasAttribute("on-key-" +
key); | 130 return instance.isActive() && instance.hasAttribute("on-key-" +
key); |
| 131 }); | 131 }); |
| 132 if (instance && instance.fire("key-" + key, event).defaultPrevented) | 132 if (instance && instance.fire("key-" + key, event).defaultPrevented) |
| 133 event.preventDefault(); | 133 event.preventDefault(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 window.addEventListener("keydown", handleKeyDown); | 136 window.addEventListener("keydown", handleKeyDown); |
| 137 })(); | 137 })(); |
| 138 </script> | 138 </script> |
| 139 </polymer-element> | 139 </polymer-element> |
| OLD | NEW |