| Index: appengine/sheriff_o_matic/ui/ct-tree-select.html
|
| diff --git a/appengine/sheriff_o_matic/ui/ct-tree-select.html b/appengine/sheriff_o_matic/ui/ct-tree-select.html
|
| index e53242d81d6703c90bc3c0a8160d2f1515fcc1d8..8a3663832af8685ef0c519c720c45afb9a61617b 100644
|
| --- a/appengine/sheriff_o_matic/ui/ct-tree-select.html
|
| +++ b/appengine/sheriff_o_matic/ui/ct-tree-select.html
|
| @@ -2,46 +2,43 @@
|
| Copyright 2014 The Chromium Authors. All rights reserved.
|
| Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| --->
|
| -
|
| -<polymer-element name="ct-tree-select" attributes="tree treeList">
|
| +--><html><head><dom-module id="ct-tree-select">
|
| <template>
|
| - <select id='treeSelect' on-change="{{ _updateTree }}" value="{{ tree }}">
|
| - <template repeat="{{ s in treeList.trees }}">
|
| + <select id="treeSelect" on-change=" _updateTree " value="{{ tree ::input}}">
|
| + <template is="dom-repeat" items="{{treeList.trees}}" as="s">
|
| <option value="{{ s.name }}">{{ s.displayName }}</option>
|
| </template>
|
| </select>
|
| </template>
|
| <script>
|
| - (function() {
|
| - Polymer({
|
| - publish: {
|
| - tree: {
|
| - reflect: true,
|
| + (function () {
|
| + Polymer({
|
| + is: 'ct-tree-select',
|
| + properties: {
|
| + tree: {
|
| + notify: true,
|
| + observer: 'treeChanged',
|
| + reflectToAttribute: true
|
| + },
|
| + treeList: { notify: true }
|
| },
|
| - },
|
| -
|
| - _updateTree: function(event) {
|
| - this.asyncFire('navigate', {
|
| - url: event.target.value
|
| - });
|
| - },
|
| -
|
| - treeChanged: function() {
|
| - if (!this.tree.length)
|
| - return;
|
| -
|
| - // Enforce the tree list, so we don't show a blank select value.
|
| - var option = this.$.treeSelect.querySelector('option[value="' + this.tree + '"]');
|
| - if (!option) {
|
| - // URL is incorrect. Replace with the root so we use the default tree.
|
| - this.asyncFire('navigate', {
|
| - url: '/',
|
| - replaceState: true
|
| - });
|
| + _updateTree: function (event) {
|
| + this.asyncFire('navigate', { url: event.target.value });
|
| + },
|
| + treeChanged: function () {
|
| + if (!this.tree.length)
|
| + return;
|
| + // Enforce the tree list, so we don't show a blank select value.
|
| + var option = this.$.treeSelect.querySelector('option[value="' + this.tree + '"]');
|
| + if (!option) {
|
| + // URL is incorrect. Replace with the root so we use the default tree.
|
| + this.asyncFire('navigate', {
|
| + url: '/',
|
| + replaceState: true
|
| + });
|
| + }
|
| }
|
| - },
|
| - });
|
| - })();
|
| + });
|
| + }());
|
| </script>
|
| -</polymer-element>
|
| +</dom-module>
|
|
|