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

Unified Diff: runtime/observatory/lib/src/elements/nav/menu_wrapper.dart

Issue 2170783003: Adding _getBoolAttribute helper method (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixed typo Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/nav/menu_wrapper.dart
diff --git a/runtime/observatory/lib/src/elements/nav/menu_wrapper.dart b/runtime/observatory/lib/src/elements/nav/menu_wrapper.dart
index b96fd0c935d45323466d59440e08104b007aa407..e0d32f9545dd01192b790c741df5c4f83582f367 100644
--- a/runtime/observatory/lib/src/elements/nav/menu_wrapper.dart
+++ b/runtime/observatory/lib/src/elements/nav/menu_wrapper.dart
@@ -37,7 +37,7 @@ class NavMenuElementWrapper extends HtmlElement {
binder.registerCallback(this);
_anchor = getAttribute('anchor');
_link = getAttribute('link');
- _last = getAttribute('') != null;
+ _last = _getBoolAttribute('last');
createShadowRoot();
render();
}
@@ -58,4 +58,9 @@ class NavMenuElementWrapper extends HtmlElement {
..children = [new ContentElement()]
];
}
+
+ bool _getBoolAttribute(String name) {
+ final String value = getAttribute(name);
+ return !(value == null || value == 'false');
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698