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
3 // found in the LICENSE file.
11 observer: 'onDisabledChanged_',
17 onButtonClicked_: function() {
21 getInputs_: function() {
22 return Polymer.dom(this.$.inputs).getDistributedNodes();
25 onKeyDown_: function(e) {
26 if (e.keyCode != 13 || this.$.button.disabled)
28 if (this.getInputs_().indexOf(e.target) == -1)
30 this.onButtonClicked_();
33 getControls_: function() {
34 var controls = this.getInputs_();
35 controls.push(this.$.button);
36 return controls.concat(Polymer.dom(this).querySelectorAll('gaia-button'));
39 onDisabledChanged_: function(disabled) {
40 this.getControls_().forEach(function(control) {
41 control.disabled = disabled;