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

Side by Side Diff: client/lib/components/closure.dart

Issue 273473002: Display function signatures instead of just "Function". (Closed) Base URL: https://github.com/dart-lang/dartdoc-viewer.git@master
Patch Set: Created 6 years, 7 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 | « client/lib/components/category.html ('k') | client/lib/components/closure.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « client/lib/components/category.html ('k') | client/lib/components/closure.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698