Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: tracing/tracing/value/ui/related_event_set_span.html

Issue 2163833002: [polymer] Fix bad merge in related_event_set_span.html (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/ui/analysis/analysis_link.html"> 8 <link rel="import" href="/tracing/ui/analysis/analysis_link.html">
9 <link rel="import" href="/tracing/value/unit.html">
9 10
10 <dom-module id="tr-v-ui-related-event-set-span"> 11 <dom-module id="tr-v-ui-related-event-set-span">
11 <script> 12 <script>
12 'use strict'; 13 'use strict';
13 Polymer({ 14 Polymer({
14 is: 'tr-v-ui-related-event-set-span', 15 is: 'tr-v-ui-related-event-set-span',
15 16
16 ready: function() { 17 ready: function() {
17 this.diagnostic_ = undefined; 18 this.diagnostic_ = undefined;
18 }, 19 },
19 20
20 get diagnostic() { 21 get diagnostic() {
21 return this.diagnostic_; 22 return this.diagnostic_;
22 }, 23 },
23 24
24 set diagnostic(d) { 25 set diagnostic(d) {
25 this.diagnostic_ = d; 26 this.diagnostic_ = d;
26 this.updateContents_(); 27 this.updateContents_();
27 }, 28 },
28 29
29 updateContents_: function() { 30 updateContents_: function() {
30 Polymer.dom(this).textContent = ''; 31 Polymer.dom(this).textContent = '';
31 var events = this.diagnostic.events; 32 var events = this.diagnostic.events;
32 var link = document.createElement('tr-ui-a-analysis-link'); 33 var link = document.createElement('tr-ui-a-analysis-link');
33 var label = (events.length === 1) ? 'event' : 'events'; 34 var label = events.length + ' events';
34 link.setSelectionAndContent(events, events.length + ' ' + label); 35 if (events.length === 1) {
36 label = events[0].title + ' ';
37 label += tr.v.Unit.byName.timeDurationInMs.format(events[0].duration);
38 }
39 link.setSelectionAndContent(events, label);
35 Polymer.dom(this).appendChild(link); 40 Polymer.dom(this).appendChild(link);
36 } 41 }
37 }); 42 });
38 </script> 43 </script>
39 </dom-module> 44 </dom-module>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698