Chromium Code Reviews| Index: client/samples/swarm/App.dart |
| diff --git a/client/samples/swarm/App.dart b/client/samples/swarm/App.dart |
| index c9659584b5f7d0f79f9077b903655e15a0e5b57e..95eadb8629a6da333d54426478e5d615aa464944 100644 |
| --- a/client/samples/swarm/App.dart |
| +++ b/client/samples/swarm/App.dart |
| @@ -25,7 +25,9 @@ class App { |
| if (document.readyState == "interactive" || |
| document.readyState == "complete" || |
| document.readyState == "loaded") { |
| - this.onLoad(); |
| + // We use setTimeout to insure that onLoad is always called in an async |
| + // manner even if the document is already loaded. |
| + window.setTimeout(() => onLoad(), 0); |
|
nweiz
2011/10/28 03:58:38
I wonder if we should have a built-in way to run c
Jacob
2011/10/31 22:09:50
I agree. Got an idea for a good name for it?
nweiz
2011/11/01 00:49:22
beforeRedraw()? runAsync()?
Jacob
2011/11/01 02:42:39
hmm. beforeRedraw is closer but not quite right.
|
| } else { |
| window.on.contentLoaded.add( |
| // TODO(sigmund): Consider eliminating the call to "wrap", for |