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

Unified Diff: samples/swarm/swarm_ui_lib/view/PagedViews.dart

Issue 27441002: Removing setImmediate and hiding WindowTimers interface (take 2) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: The fix Created 7 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 | « samples/swarm/swarm_ui_lib/touch/Scroller.dart ('k') | samples/swarm/swarm_ui_lib/view/SliderMenu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/swarm/swarm_ui_lib/view/PagedViews.dart
diff --git a/samples/swarm/swarm_ui_lib/view/PagedViews.dart b/samples/swarm/swarm_ui_lib/view/PagedViews.dart
index e7bf4914b8c37309d4202dba533a7e1cba04376b..300f2cac2971f4026429650eed2e6bc5db6d78aa 100644
--- a/samples/swarm/swarm_ui_lib/view/PagedViews.dart
+++ b/samples/swarm/swarm_ui_lib/view/PagedViews.dart
@@ -135,7 +135,7 @@ class PagedColumnView extends View {
// TODO(jmesserly): would be better to not have this code in enterDocument.
// But we need computedStyle to read our CSS properties.
void enterDocument() {
- window.setImmediate(() {
+ scheduleMicrotask(() {
var style = contentView.node.getComputedStyle();
_computeColumnGap(style);
@@ -183,7 +183,7 @@ class PagedColumnView extends View {
// The content needs to have its height explicitly set, or columns don't
// flow to the right correctly. So we copy our own height and set the height
// of the content.
- window.setImmediate(() {
+ scheduleMicrotask(() {
contentView.node.style.height = '${node.offset.height}px';
});
_updatePageCount(null);
@@ -191,7 +191,7 @@ class PagedColumnView extends View {
bool _updatePageCount(Callback callback) {
int pageLength = 1;
- window.setImmediate(() {
+ scheduleMicrotask(() {
if (_container.scrollWidth > _container.offset.width) {
pageLength = (_container.scrollWidth / _computePageSize(_container))
.ceil();
@@ -216,7 +216,7 @@ class PagedColumnView extends View {
}
void _onContentMoved(Event e) {
- window.setImmediate(() {
+ scheduleMicrotask(() {
num current = scroller.contentOffset.x;
int pageSize = _computePageSize(_container);
pages.current.value = -(current / pageSize).round();
@@ -226,7 +226,7 @@ class PagedColumnView extends View {
void _snapToPage(Event e) {
num current = scroller.contentOffset.x;
num currentTarget = scroller.currentTarget.x;
- window.setImmediate(() {
+ scheduleMicrotask(() {
int pageSize = _computePageSize(_container);
int destination;
num currentPageNumber = -(current / pageSize).round();
@@ -277,7 +277,7 @@ class PagedColumnView extends View {
}
void _onPageSelected() {
- window.setImmediate(() {
+ scheduleMicrotask(() {
int translate = -pages.target.value * _computePageSize(_container);
scroller.throwTo(translate, 0);
});
« no previous file with comments | « samples/swarm/swarm_ui_lib/touch/Scroller.dart ('k') | samples/swarm/swarm_ui_lib/view/SliderMenu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698