1 <!-- 2 Copyright 2014 The Chromium Authors. All rights reserved. 3 Use of this source code is governed by a BSD-style license that can be 4 found in the LICENSE file. 5 --> 6 <link rel="import" href="../bower_components/core-localstorage/core-localstorage.html"> 7 8 <polymer-element name="ct-tree-select" attributes="tree treeList"> 9 <template> 10 <core-localstorage name="ct-tree-select-storage" value="{{ tree }}"></core-localstorage> 11 <select on-change="{{ _updateTree }}"> 12 <template repeat="{{ s in treeList.trees }}"> 13 <option value="{{ s.name }}" selected?="{{ s.name == tree }}">{{ s.displayName }}</option> 14 </template> 15 </select> 16 </template> 17 <script> 18 (function() { 19 Polymer({ 20 publish: { 21 tree: { 22 reflect: true, 23 }, 24 }, 25 26 _updateTree: function(event) { 27 this.tree = event.target.selectedOptions[0].value; 28 }, 29 }); 30 })(); 31 </script> 32 </polymer-element> 33