| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library web.parameters; |
| 6 |
| 7 import 'dart:html'; |
| 8 |
| 9 import 'package:polymer/polymer.dart'; |
| 10 |
| 11 import 'package:dartdoc_viewer/item.dart'; |
| 12 |
| 13 import 'type.dart'; |
| 14 import 'parameters.dart'; |
| 15 |
| 16 /** |
| 17 * An element representing a function that is passed in as a parameter to a |
| 18 * method. |
| 19 */ |
| 20 @CustomTag("dartdoc-closure") |
| 21 class ClosureElement extends PolymerElement { |
| 22 @observable Closure closure; |
| 23 |
| 24 factory ClosureElement() => new Element.tag('dartdoc-closure'); |
| 25 ClosureElement.created() : super.created(); |
| 26 |
| 27 void closureChanged() { |
| 28 this.children.clear(); |
| 29 |
| 30 var outerSpan = new SpanElement(); |
| 31 if (!closure.returnType.isDynamic) { |
| 32 outerSpan.append(new TypeElement()..type = closure.returnType); |
| 33 outerSpan.appendText(' '); |
| 34 } |
| 35 |
| 36 var parameterName = new AnchorElement() |
| 37 ..text = closure.name |
| 38 ..href = closure.prefixedAnchorHref |
| 39 ..id = closure.anchorHrefLocation.anchor; |
| 40 |
| 41 outerSpan.append(parameterName); |
| 42 outerSpan.append(new ParameterElement() |
| 43 ..parameters = closure.parameters); |
| 44 this.append(outerSpan); |
| 45 } |
| 46 } |
| OLD | NEW |