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

Side by Side Diff: runtime/observatory/lib/src/elements/isolate_ref.dart

Issue 2119733003: Wrapping leaf nodes in non polymer elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library isolate_ref_element; 5 library isolate_ref_element;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'dart:html';
8 import 'service_ref.dart'; 8 import 'package:observatory/service_html.dart';
9 import 'helpers/tag.dart';
9 10
10 @CustomTag('isolate-ref') 11 class IsolateRefElement extends HtmlElement {
11 class IsolateRefElement extends ServiceRefElement { 12 static final StyleElement _style = () {
12 IsolateRefElement.created() : super.created(); 13 var style = new StyleElement();
14 style.text = 'a {'
15 ' color: #0489c3;'
16 ' text-decoration: none;'
17 '}'
18 'a:hover {'
19 ' text-decoration: underline;'
20 '}';
21 return style;
22 }();
23
24 static const tag = const Tag<IsolateRefElement>('isolate-ref-wrapped');
25
26 Isolate isolate;
27
28 factory IsolateRefElement({Isolate isolate}) {
29 IsolateRefElement e = document.createElement(tag.name);
30 e.isolate = isolate;
31 return e;
32 }
33
34 IsolateRefElement.created() : super.created() {
35 createShadowRoot();
36 }
37
38 @override
39 void attached() {
40 super.attached();
41 render();
42 }
43
44 void render() {
45 shadowRoot.children = [];
46 if (isolate == null) return;
47
48 shadowRoot.children = [
49 _style.clone(true),
50 new AnchorElement(href:
51 '#/inspect?isolateId=${Uri.encodeComponent(isolate.id)}')
Cutch 2016/07/01 17:33:36 We should probably delegate the href building to s
52 ..text = 'Isolate ${isolate.number} (${isolate.name})'
53 ];
54 }
13 } 55 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/instance_view.html ('k') | runtime/observatory/lib/src/elements/isolate_ref.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698