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

Unified Diff: pkg/dartdoc/lib/src/client/client-shared.dart

Issue 10985085: Members and comments inherited in dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dartdoc/lib/mirrors_util.dart ('k') | pkg/dartdoc/lib/src/dartdoc/comment_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/lib/src/client/client-shared.dart
diff --git a/pkg/dartdoc/lib/src/client/client-shared.dart b/pkg/dartdoc/lib/src/client/client-shared.dart
index 854b617ae4ffbe304ff8fab81fe4152fc1ddcfb0..bddaa1226c46821ec37b15b312270bae84989c9c 100644
--- a/pkg/dartdoc/lib/src/client/client-shared.dart
+++ b/pkg/dartdoc/lib/src/client/client-shared.dart
@@ -15,6 +15,7 @@ void setup() {
setupLocation();
setupShortcuts();
enableCodeBlocks();
+ enableShowHideInherited();
}
void setupLocation() {
@@ -54,6 +55,29 @@ enableCodeBlocks() {
}
}
+/**
+ * Enables show/hide functionality for inherited members and comments.
+ */
+void enableShowHideInherited() {
+ var showInherited = document.query('#show-inherited');
+ if (showInherited == null) return;
+ showInherited.dataAttributes.putIfAbsent('show-inherited', () => 'block');
+ showInherited.on.click.add((e) {
+ String display = showInherited.dataAttributes['show-inherited'];
+ if (display == 'block') {
+ display = 'none';
+ showInherited.innerHTML = 'Show inherited';
+ } else {
+ display = 'block';
+ showInherited.innerHTML = 'Hide inherited';
+ }
+ showInherited.dataAttributes['show-inherited'] = display;
+ for (var elem in document.queryAll('.inherited')) {
+ elem.style.display = display;
+ }
+ });
+
+}
/** Turns [name] into something that's safe to use as a file name. */
String sanitize(String name) => name.replaceAll(':', '_').replaceAll('/', '_');
« no previous file with comments | « pkg/dartdoc/lib/mirrors_util.dart ('k') | pkg/dartdoc/lib/src/dartdoc/comment_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698