Chromium Code Reviews| 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 library function_ref_element; | 5 library function_ref_element; |
| 6 | 6 |
| 7 import 'package:polymer/polymer.dart'; | 7 import 'package:polymer/polymer.dart'; |
| 8 import 'service_ref.dart'; | 8 import 'service_ref.dart'; |
| 9 | 9 |
| 10 @CustomTag('function-ref') | 10 @CustomTag('function-ref') |
| 11 class FunctionRefElement extends ServiceRefElement { | 11 class FunctionRefElement extends ServiceRefElement { |
| 12 @published bool qualified = true; | |
| 13 | |
| 14 void refChanged(oldValue) { | |
| 15 super.refChanged(oldValue); | |
| 16 notifyPropertyChange(#hasParent, 0, 1); | |
| 17 notifyPropertyChange(#hasClass, 0, 1); | |
| 18 } | |
| 19 | |
| 20 @observable | |
| 21 bool get hasParent { | |
| 22 return (ref != null && ref['parent'] != null); | |
| 23 } | |
| 24 | |
| 25 @observable | |
| 26 bool get hasClass { | |
|
Cutch
2014/03/14 19:45:20
These are better as fields which you set in refCha
| |
| 27 return (ref != null && | |
| 28 ref['class'] != null && | |
| 29 ref['class']['name'] != null && | |
| 30 ref['class']['name'] != '::'); | |
| 31 } | |
| 32 | |
| 12 FunctionRefElement.created() : super.created(); | 33 FunctionRefElement.created() : super.created(); |
| 13 } | 34 } |
| OLD | NEW |