| 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 * @fileoverview Polymer element for displaying the network state for a specific | 6 * @fileoverview Polymer element for displaying the network state for a specific |
| 7 * type and a list of networks for that type. | 7 * type and a list of networks for that type. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ | 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 expandedChanged_: function() { | 76 expandedChanged_: function() { |
| 77 var type = this.deviceState ? this.deviceState.Type : ''; | 77 var type = this.deviceState ? this.deviceState.Type : ''; |
| 78 this.fire('expanded', {expanded: this.expanded, type: type}); | 78 this.fire('expanded', {expanded: this.expanded, type: type}); |
| 79 }, | 79 }, |
| 80 | 80 |
| 81 /** | 81 /** |
| 82 * Polymer deviceState changed method. | 82 * Polymer deviceState changed method. |
| 83 */ | 83 */ |
| 84 deviceStateChanged_: function() { | 84 deviceStateChanged_: function() { |
| 85 this.updateSelectable_(); | 85 this.updateSelectable_(); |
| 86 if (!this.deviceIsEnabled_(this.deviceState)) | 86 if (this.expanded && !this.deviceIsEnabled_(this.deviceState)) |
| 87 this.expanded = false; | 87 this.expanded = false; |
| 88 }, | 88 }, |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * Polymer networkStateList changed method. | 91 * Polymer networkStateList changed method. |
| 92 */ | 92 */ |
| 93 networkStateListChanged_: function() { | 93 networkStateListChanged_: function() { |
| 94 this.updateSelectable_(); | 94 this.updateSelectable_(); |
| 95 }, | 95 }, |
| 96 | 96 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 /** | 222 /** |
| 223 * Called whenever the 'selectable' state might change. | 223 * Called whenever the 'selectable' state might change. |
| 224 * @private | 224 * @private |
| 225 */ | 225 */ |
| 226 updateSelectable_: function() { | 226 updateSelectable_: function() { |
| 227 var selectable = this.deviceIsEnabled_(this.deviceState); | 227 var selectable = this.deviceIsEnabled_(this.deviceState); |
| 228 this.$.details.classList.toggle('selectable', selectable); | 228 this.$.details.classList.toggle('selectable', selectable); |
| 229 }, | 229 }, |
| 230 }); | 230 }); |
| OLD | NEW |