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); |
michaelpg
2015/05/08 22:02:23
this.classList.add('custom-appearance');
dzhioev (left Google)
2015/05/08 22:29:02
Done.
| |
16 this.fire('tap'); | 16 }, |
17 | |
18 onMouseDown: function(e) { | |
19 /* Prevents button focusing after mouse click. */ | |
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 |