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-input-form', (function() { | 6 Polymer('gaia-input-form', (function() { |
7 return { | 7 return { |
8 onButtonClicked: function() { | 8 onButtonClicked: function() { |
9 this.fire('submit'); | 9 this.fire('submit'); |
10 }, | 10 }, |
11 | 11 |
12 onKeyDown: function(e) { | 12 onKeyDown: function(e) { |
13 if (e.keyCode == 13 && !this.$.button.disabled) | 13 if (e.keyCode == 13 && !this.$.button.disabled) |
14 this.onButtonClicked(); | 14 this.onButtonClicked(); |
15 } | 15 }, |
| 16 |
| 17 set disabled(value) { |
| 18 var controls = this.querySelectorAll( |
| 19 ':host /deep/ [role="button"], :host /deep/ [is="core-input"]'); |
| 20 for (var i = 0, control; control = controls[i]; ++i) |
| 21 control.disabled = value; |
| 22 }, |
16 }; | 23 }; |
17 })()); | 24 })()); |
OLD | NEW |