| <!DOCTYPE html> |
| <!-- |
| Copyright 2015 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. |
| --> |
| |
| <link rel="import" href="/extras/rail/rail_score.html"> |
| <link rel="import" href="/extras/rail/rail_score_span.html"> |
| <link rel="import" href="/base/ui/table.html"> |
| <link rel="import" href="/core/side_panel/side_panel.html"> |
| |
| <polymer-element name='tr-e-rail-rail-score-side-panel' |
| extends='tr-c-side-panel'> |
| <template> |
| <style> |
| :host { |
| display: flex; |
| width: 250px; |
| } |
| #content { |
| flex-direction: column; |
| display: flex; |
| } |
| </style> |
| |
| <tr-e-rail-rail-score-span id='score'></tr-e-rail-rail-score-span> |
| <tr-ui-table id="table"></tr-ui-table> |
| </template> |
| |
| <script> |
| 'use strict'; |
| |
| Polymer({ |
| ready: function() { |
| this.rangeOfInterest_ = new tr.b.Range(); |
| this.model_ = undefined; |
| this.railScore_ = undefined; |
| }, |
| |
| get textLabel() { |
| return 'RAIL Info'; |
| }, |
| |
| supportsModel: function(m) { |
| if (m === undefined) { |
| return { |
| supported: false, |
| reason: 'Unknown tracing model' |
| }; |
| } |
| |
| var railScore = tr.e.rail.RAILScore.fromModel(m); |
| if (railScore === undefined) { |
| return { |
| supported: false, |
| reason: 'RAIL interactions were not found on the model' |
| }; |
| } |
| |
| return { |
| supported: true |
| }; |
| }, |
| |
| get model() { |
| return this.model_; |
| }, |
| |
| set model(model) { |
| this.model_ = model; |
| this.railScore_ = tr.e.rail.RAILScore.fromModel(model); |
| this.$.score.railScore = this.railScore_; |
| this.updateTable_(); |
| }, |
| |
| get listeningToKeys() { |
| return false; |
| }, |
| |
| set selection(selection) { |
| }, |
| |
| set rangeOfInterest(rangeOfInterest) { |
| }, |
| |
| updateTable_: function() { |
| } |
| }); |
| </script> |
| </polymer-element> |