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

Side by Side Diff: samples/swipe/web/swipe.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library swipe; 5 library swipe;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:math'; 9 import 'dart:math';
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 }); 67 });
68 68
69 document.onKeyUp.listen((event) => stopSpin()); 69 document.onKeyUp.listen((event) => stopSpin());
70 } 70 }
71 71
72 void initialize3D() { 72 void initialize3D() {
73 target.classes.add("transformable"); 73 target.classes.add("transformable");
74 74
75 num childCount = target.children.length; 75 num childCount = target.children.length;
76 76
77 window.setImmediate(() { 77 scheduleMicrotask(() {
78 num width = query("#target").client.width; 78 num width = query("#target").client.width;
79 figureWidth = (width / 2) ~/ tan(PI / childCount); 79 figureWidth = (width / 2) ~/ tan(PI / childCount);
80 80
81 target.style.transform = "translateZ(-${figureWidth}px)"; 81 target.style.transform = "translateZ(-${figureWidth}px)";
82 82
83 num radius = (figureWidth * 1.2).round(); 83 num radius = (figureWidth * 1.2).round();
84 query('#container2').style.width = "${radius}px"; 84 query('#container2').style.width = "${radius}px";
85 85
86 for (int i = 0; i < childCount; i++) { 86 for (int i = 0; i < childCount; i++) {
87 var panel = target.children[i]; 87 var panel = target.children[i];
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 /** 121 /**
122 * Stop any spin that may be in progress. 122 * Stop any spin that may be in progress.
123 */ 123 */
124 void stopSpin() { 124 void stopSpin() {
125 if (timer != null) { 125 if (timer != null) {
126 timer.cancel(); 126 timer.cancel();
127 timer = null; 127 timer = null;
128 } 128 }
129 } 129 }
OLDNEW
« no previous file with comments | « samples/swarm/test/swarm_ui_lib/layout/grid_layout_demo.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698