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.
6 * @fileoverview Polymer element for displaying a collapsable list of networks.
12 * Polymer class definition for 'network-list'.
13 * TODO(stevenjb): Update with iron-list(?) once implemented in Polymer 1.0.
14 * @element network-list
21 * The maximum height in pixels for the list.
26 observer: 'maxHeightChanged_'
30 * The list of network state properties for the items to display.
32 * @type {!Array<!CrOnc.NetworkStateProperties>}
36 value: function() { return []; }
40 * True if the list is opened.
49 * Polymer maxHeight changed method.
51 maxHeightChanged_: function() {
52 this.$.container.style.maxHeight = this.maxHeight + 'px';
56 * Called when the cr-collapse element changes size (i.e. is opened).
59 onResized_: function() {
61 this.$.networkList.updateSize();
65 * Event triggered when a list item is selected.
66 * @param {!{target: !NetworkListItem}} event
69 onSelected_: function(event) {
70 this.fire('selected', event.model.item);