Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright 2015 The Chromium Authors. All rights reserved. | 1 /* Copyright 2015 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 Polymer('gaia-paper-button', { | 6 Polymer('gaia-paper-button', { |
| 7 onKeyDown: function(e) { | 7 onKeyDown: function(e) { |
| 8 if (e.keyCode == 13 || e.keyCode == 32) | 8 if (e.keyCode == 13 || e.keyCode == 32) |
| 9 this.fire('tap'); | 9 this.fire('tap'); |
| 10 } | 10 } |
| 11 }); | 11 }); |
| 12 | 12 |
| 13 Polymer('gaia-core-icon-button', { | 13 Polymer('gaia-icon-button', { |
| 14 onKeyDown: function(e) { | 14 ready: function() { |
| 15 if (e.keyCode == 13 || e.keyCode == 32) | 15 this.classList.toggle('custom-appearance', true); |
| 16 this.fire('tap'); | 16 }, |
| 17 | |
| 18 onMouseDown: function(e) { | |
| 19 /* Prevents button focusing after mouse click. */ | |
|
Greg Levin
2015/05/08 19:18:07
Is this desirable? Most buttons seem to retain fo
dzhioev (left Google)
2015/05/08 21:15:45
Yes, we do this thing for the most buttons in our
Greg Levin
2015/05/11 14:33:50
Right, but it's not clear to me that we *want* to
dzhioev (left Google)
2015/05/11 23:05:57
Got it, I'll keep current behavior for now and con
| |
| 20 e.preventDefault(); | |
| 17 } | 21 } |
| 18 }); | 22 }); |
| 19 | 23 |
| 20 Polymer('gaia-raised-on-focus-button', { | 24 Polymer('gaia-raised-on-focus-button', { |
| 21 onButtonFocus: function() { | 25 onButtonFocus: function() { |
| 22 this.raised = true; | 26 this.raised = true; |
| 23 }, | 27 }, |
| 24 | 28 |
| 25 onButtonBlur: function() { | 29 onButtonBlur: function() { |
| 26 this.raised = false; | 30 this.raised = false; |
| 27 }, | 31 }, |
| 28 }); | 32 }); |
| OLD | NEW |