Index: frog/gen.dart |
=================================================================== |
--- frog/gen.dart (revision 5935) |
+++ frog/gen.dart (working copy) |
@@ -122,7 +122,13 @@ |
writeDynamicDispatchMetadata(); |
writeGlobals(); |
- writer.writeln('${mainCall.code};'); |
+ writer.writeln("if (typeof window != 'undefined' && window.addEventListener) {"); |
vsm
2012/03/28 17:17:57
line length > 80?
|
+ writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {"); |
+ writer.writeln(" ${mainCall.code};"); |
+ writer.writeln(" });"); |
+ writer.writeln("} else {"); |
+ writer.writeln(" ${mainCall.code};"); |
+ writer.writeln("}"); |
} |
void markLibrariesUsed(List<Library> libs) => |