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

Unified Diff: client/samples/swarm/Views.dart

Issue 9145004: Revert "Example showing alternate async measurement solution" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « client/samples/dartcombat/views.dart ('k') | client/samples/total/src/HtmlTable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/samples/swarm/Views.dart
diff --git a/client/samples/swarm/Views.dart b/client/samples/swarm/Views.dart
index e602d9c9e5d5e2ff8a16f3ec8e767cbeb3f00c63..c02a00e77238ae9f67e1a31a96de3333b6853b3b 100644
--- a/client/samples/swarm/Views.dart
+++ b/client/samples/swarm/Views.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -288,27 +288,25 @@ class GenericListView<D> extends View {
void onResize() {
- window.requestMeasurementFrame(() {
- int lastViewLength = _viewLength;
- final offset = node.rect.offset;
- _viewLength = _vertical ? offset.height : offset.width;
+ int lastViewLength = _viewLength;
+ node.rect.then((ElementRect rect) {
+ _viewLength = _vertical ? rect.offset.height : rect.offset.width;
if (_viewLength != lastViewLength) {
- return () {
- if (_scrollbar != null) {
- _scrollbar.refresh();
- }
- renderVisibleItems(true);
- };
+ if (_scrollbar != null) {
+ _scrollbar.refresh();
+ }
+ renderVisibleItems(true);
}
});
}
void enterDocument() {
if (scroller != null) {
+ onResize();
+
if (_scrollbar != null) {
_scrollbar.initialize();
}
- onResize();
}
}
« no previous file with comments | « client/samples/dartcombat/views.dart ('k') | client/samples/total/src/HtmlTable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698