| OLD | NEW |
| 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 import 'dart:html'; | 5 import 'dart:html'; |
| 6 | 6 |
| 7 import 'package:observatory/app.dart'; | 7 import 'package:observatory/app.dart'; |
| 8 import 'package:observatory/service_html.dart' show Class; | 8 import 'package:observatory/service_html.dart' show Class; |
| 9 import 'package:observatory/src/elements/class_ref.dart'; | 9 import 'package:observatory/src/elements/class_ref.dart'; |
| 10 import 'package:observatory/src/elements/helpers/tag.dart'; | 10 import 'package:observatory/src/elements/helpers/tag.dart'; |
| 11 import 'package:observatory/src/elements/shims/binding.dart'; | 11 import 'package:observatory/src/elements/shims/binding.dart'; |
| 12 | 12 |
| 13 @bindable | 13 @bindable |
| 14 class ClassRefElementWrapper extends HtmlElement { | 14 class ClassRefElementWrapper extends HtmlElement { |
| 15 | 15 |
| 16 static const binder = const Binder<ClassRefElementWrapper>(const { | 16 static const binder = const Binder<ClassRefElementWrapper>(const { |
| 17 'ref': #ref | 17 'ref': #ref |
| 18 }); | 18 }); |
| 19 | 19 |
| 20 static const tag = const Tag<ClassRefElementWrapper>('class-ref'); | 20 static const tag = const Tag<ClassRefElementWrapper>('class-ref'); |
| 21 | 21 |
| 22 Class _class; | 22 Class _class; |
| 23 Class get ref => _class; | 23 Class get ref => _class; |
| 24 void set ref(Class ref) { _class = ref; render(); } | 24 void set ref(Class ref) { |
| 25 _class = ref; |
| 26 render(); |
| 27 } |
| 25 | 28 |
| 26 ClassRefElementWrapper.created() : super.created() { | 29 ClassRefElementWrapper.created() : super.created() { |
| 27 binder.registerCallback(this); | 30 binder.registerCallback(this); |
| 28 createShadowRoot(); | 31 createShadowRoot(); |
| 29 render(); | 32 render(); |
| 30 } | 33 } |
| 31 | 34 |
| 32 @override | 35 @override |
| 33 void attached() { | 36 void attached() { |
| 34 super.attached(); | 37 super.attached(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 47 } | 50 } |
| 48 class-ref-wrapped > a[href] { | 51 class-ref-wrapped > a[href] { |
| 49 color: #0489c3; | 52 color: #0489c3; |
| 50 text-decoration: none; | 53 text-decoration: none; |
| 51 }''', | 54 }''', |
| 52 new ClassRefElement(_class.isolate, _class, | 55 new ClassRefElement(_class.isolate, _class, |
| 53 queue: ObservatoryApplication.app.queue) | 56 queue: ObservatoryApplication.app.queue) |
| 54 ]; | 57 ]; |
| 55 } | 58 } |
| 56 } | 59 } |
| OLD | NEW |