| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * The global object. | 6 * The global object. |
| 7 * @type {!Object} | 7 * @type {!Object} |
| 8 * @const | 8 * @const |
| 9 */ | 9 */ |
| 10 var global = this; | 10 var global = this; |
| (...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1753 | 1753 |
| 1754 /** @this {ActionLink} */ | 1754 /** @this {ActionLink} */ |
| 1755 createdCallback: function() { | 1755 createdCallback: function() { |
| 1756 // Action links can start disabled (e.g. <a is="action-link" disabled>). | 1756 // Action links can start disabled (e.g. <a is="action-link" disabled>). |
| 1757 this.tabIndex = this.disabled ? -1 : 0; | 1757 this.tabIndex = this.disabled ? -1 : 0; |
| 1758 | 1758 |
| 1759 if (!this.hasAttribute('role')) | 1759 if (!this.hasAttribute('role')) |
| 1760 this.setAttribute('role', 'link'); | 1760 this.setAttribute('role', 'link'); |
| 1761 | 1761 |
| 1762 this.addEventListener('keydown', function(e) { | 1762 this.addEventListener('keydown', function(e) { |
| 1763 if (!this.disabled && e.keyIdentifier == 'Enter') { | 1763 if (!this.disabled && e.keyIdentifier == 'Enter' && !this.href) { |
| 1764 // Schedule a click asynchronously because other 'keydown' handlers | 1764 // Schedule a click asynchronously because other 'keydown' handlers |
| 1765 // may still run later (e.g. document.addEventListener('keydown')). | 1765 // may still run later (e.g. document.addEventListener('keydown')). |
| 1766 // Specifically options dialogs break when this timeout isn't here. | 1766 // Specifically options dialogs break when this timeout isn't here. |
| 1767 // NOTE: this affects the "trusted" state of the ensuing click. I | 1767 // NOTE: this affects the "trusted" state of the ensuing click. I |
| 1768 // haven't found anything that breaks because of this (yet). | 1768 // haven't found anything that breaks because of this (yet). |
| 1769 window.setTimeout(this.click.bind(this), 0); | 1769 window.setTimeout(this.click.bind(this), 0); |
| 1770 } | 1770 } |
| 1771 }); | 1771 }); |
| 1772 | 1772 |
| 1773 function preventDefault(e) { | 1773 function preventDefault(e) { |
| (...skipping 8691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10465 Manager.get().updateItem_(index, data); | 10465 Manager.get().updateItem_(index, data); |
| 10466 }; | 10466 }; |
| 10467 | 10467 |
| 10468 return {Manager: Manager}; | 10468 return {Manager: Manager}; |
| 10469 }); | 10469 }); |
| 10470 // Copyright 2015 The Chromium Authors. All rights reserved. | 10470 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 10471 // Use of this source code is governed by a BSD-style license that can be | 10471 // Use of this source code is governed by a BSD-style license that can be |
| 10472 // found in the LICENSE file. | 10472 // found in the LICENSE file. |
| 10473 | 10473 |
| 10474 window.addEventListener('load', downloads.Manager.onLoad); | 10474 window.addEventListener('load', downloads.Manager.onLoad); |
| OLD | NEW |