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

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

Issue 2159273004: Added helper function to automatically dirty a RenderingScheduler on attribute change (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Added comments to new helper method 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
Index: runtime/observatory/lib/src/elements/nav/menu.dart
diff --git a/runtime/observatory/lib/src/elements/nav/menu.dart b/runtime/observatory/lib/src/elements/nav/menu.dart
index 16dbf08d1d2797c93c5000362acaab2b069f4f54..036ece860fea3578e91c99edcbce812fe8a14218 100644
--- a/runtime/observatory/lib/src/elements/nav/menu.dart
+++ b/runtime/observatory/lib/src/elements/nav/menu.dart
@@ -56,31 +56,9 @@ class NavMenuElement extends HtmlElement implements Renderable {
String get label => _label;
String get link => _link;
bool get last => _last;
- set label(String value) {
- if (_label != value) {
- _label = value;
- _r.dirty();
- } else {
- _r.scheduleNotification();
- }
- }
- set link(String value) {
- if (_link != value) {
- _link = value;
- _r.dirty();
- } else {
- _r.scheduleNotification();
- }
- }
- set last(bool value) {
- if (_last != value) {
- _last = value;
- _r.dirty();
- } else {
- _r.scheduleNotification();
- }
- }
-
+ set label(String value) => _label = _r.checkAndReact(_label, value);
+ set link(String value) => _link = _r.checkAndReact(_link, value);
+ set last(bool value) => _last = _r.checkAndReact(_link, value);
factory NavMenuElement(String label, {String link, bool last: false,
RenderingQueue queue}) {

Powered by Google App Engine
This is Rietveld 408576698