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

Side by Side Diff: utils/dartdoc/interact.dart

Issue 8822001: Bunch of dartdoc changes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Default to showing source. Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « utils/dartdoc/dartdoc.dart ('k') | utils/dartdoc/static/styles.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** Provides client-side behavior for generated docs. */ 5 /** Provides client-side behavior for generated docs. */
6 #library('interact'); 6 #library('interact');
7 7
8 #import('dart:html'); 8 #import('dart:html');
9 9
10 main() { 10 main() {
11 window.on.contentLoaded.add((e) { 11 window.on.contentLoaded.add((e) {
12 for (var elem in document.queryAll('.method, .field')) { 12 for (var elem in document.queryAll('.method, .field')) {
13 var showCode = elem.query('.show-code'); 13 var showCode = elem.query('.show-code');
14
15 // Skip it if we don't have a code link. Will happen if source code is
16 // disabled.
17 if (showCode == null) continue;
18
14 var pre = elem.query('pre.source'); 19 var pre = elem.query('pre.source');
15 showCode.on.click.add((e) { 20 showCode.on.click.add((e) {
16 if (pre.classes.contains('expanded')) { 21 if (pre.classes.contains('expanded')) {
17 pre.classes.remove('expanded'); 22 pre.classes.remove('expanded');
18 } else { 23 } else {
19 pre.classes.add('expanded'); 24 pre.classes.add('expanded');
20 } 25 }
21 }); 26 });
22 } 27 }
23 }); 28 });
24 } 29 }
OLDNEW
« no previous file with comments | « utils/dartdoc/dartdoc.dart ('k') | utils/dartdoc/static/styles.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698