| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --><html><head><link rel="import" href="../bower_components/iron-pages/iron-page
s.html"> |
| 6 | |
| 7 <link rel="import" href="../bower_components/core-pages/core-pages.html"> | |
| 8 <link rel="import" href="../bower_components/paper-tabs/paper-tab.html"> | 6 <link rel="import" href="../bower_components/paper-tabs/paper-tab.html"> |
| 9 <link rel="import" href="../bower_components/paper-tabs/paper-tabs.html"> | 7 <link rel="import" href="../bower_components/paper-tabs/paper-tabs.html"> |
| 10 <link rel="import" href="ct-results-detail.html"> | 8 <link rel="import" href="ct-results-detail.html"> |
| 11 | 9 |
| 12 <polymer-element name="ct-results-by-builder" attributes="failure"> | 10 <!-- |
| 13 <template> | 11 TODO(polyup): unable to infer path to components |
| 14 <style> | 12 directory. This import path is probably incomplete. |
| 13 --> |
| 14 <link rel="import" href="iron-flex-layout/iron-flex-layout.html"> |
| 15 <dom-module id="ct-results-by-builder"> |
| 16 <style> |
| 17 /* TODO(polyup): For speed, consider reworking these styles with .classes |
| 18 and #ids rather than [attributes]. |
| 19 */ |
| 20 [layout] { |
| 21 @apply(--layout); |
| 22 } |
| 23 [layout][vertical] { |
| 24 @apply(--layout-vertical); |
| 25 } |
| 26 [layout][flex] { |
| 27 @apply(--layout-flex); |
| 28 } |
| 29 </style> |
| 30 <style> |
| 15 :host { | 31 :host { |
| 16 display: block; | 32 display: block; |
| 17 } | 33 } |
| 18 paper-tabs::shadow #selectionBar { | 34 paper-tabs::shadow #selectionBar { |
| 19 background-color: #212121; | 35 background-color: #212121; |
| 20 height: 4px; | 36 height: 4px; |
| 21 } | 37 } |
| 22 paper-tab { | 38 paper-tab { |
| 23 border: 1px solid #212121; | 39 border: 1px solid #212121; |
| 24 border-radius: 5px 5px 0 0; | 40 border-radius: 5px 5px 0 0; |
| 25 } | 41 } |
| 26 paper-tab::shadow #ink { | 42 paper-tab::shadow #ink { |
| 27 color: #212121; | 43 color: #212121; |
| 28 } | 44 } |
| 29 </style> | 45 </style> |
| 46 <template> |
| 30 <paper-tabs selected="{{ selected }}"> | 47 <paper-tabs selected="{{ selected }}"> |
| 31 <template repeat="{{ builder in builders }}"> | 48 <template is="dom-repeat" items="{{builders}}" as="builder"> |
| 32 <paper-tab>{{ builder }}</paper-tab> | 49 <paper-tab>{{ builder }}</paper-tab> |
| 33 </template> | 50 </template> |
| 34 </paper-tabs> | 51 </paper-tabs> |
| 35 <ct-results-detail flex layout vertical failure="{{ failure }}" builder="{{
builders[selected] }}"></ct-results-detail> | 52 <ct-results-detail flex="" layout="" vertical="" failure="{{ failure }}" bui
lder="{{computeBuilder(builders, selected)}}"></ct-results-detail> |
| 36 </template> | 53 </template> |
| 37 <script> | 54 <script> |
| 38 Polymer({ | 55 Polymer({ |
| 39 failure: null, | 56 is: 'ct-results-by-builder', |
| 40 builders: [], | 57 properties: { |
| 41 selected: 0, | 58 builders: { |
| 42 | 59 type: Array, |
| 43 failureChanged: function() { | 60 value: function () { |
| 61 return []; |
| 62 } |
| 63 }, |
| 64 failure: { |
| 65 value: null, |
| 66 notify: true, |
| 67 observer: 'failureChanged' |
| 68 }, |
| 69 selected: { |
| 70 type: Number, |
| 71 value: 0 |
| 72 } |
| 73 }, |
| 74 failureChanged: function () { |
| 44 this.builders = Object.getOwnPropertyNames(this.failure.resultNodesByBui
lder).sort(); | 75 this.builders = Object.getOwnPropertyNames(this.failure.resultNodesByBui
lder).sort(); |
| 45 this.selected = 0; | 76 this.selected = 0; |
| 46 }, | 77 }, |
| 78 computeBuilder: function (builders, selected) { |
| 79 return builders[selected]; |
| 80 } |
| 47 }); | 81 }); |
| 48 </script> | 82 </script> |
| 49 </polymer-element> | 83 </dom-module> |
| OLD | NEW |