Permalink
Browse files

Merge pull request #41 from gregolsen/bugfix

attachEvent fixed for IE - onload should be used instead of load
  • Loading branch information...
2 parents 80d9e57 + 61758d6 commit 789b81482287d81f6a6be99822f5c89038a75b8f @jnicklas jnicklas committed Nov 29, 2011
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/evergreen/views/run.erb
@@ -32,13 +32,18 @@
<% @suite.templates.each do |template| %>
Evergreen.templates[<%= template.name.to_json %>] = <%= template.escaped_contents %>;
<% end %>
- eventFunction = window.addEventListener ? 'addEventListener' : 'attachEvent';
- window[eventFunction]('load', function() {
+ var jasmineExecute = function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.addReporter(new jasmine.TrivialReporter());
jasmineEnv.addReporter(new Evergreen.ReflectiveReporter());
jasmineEnv.execute();
- });
+ };
+ if (window.addEventListener) {
+ window.addEventListener("load", jasmineExecute, false);
+ }
+ else {
+ window.attachEvent("onload", jasmineExecute);
+ }
})();
// ]]>
</script>

0 comments on commit 789b814

Please sign in to comment.