Skip to content

Commit

Permalink
Merge pull request #41 from gregolsen/bugfix
Browse files Browse the repository at this point in the history
attachEvent fixed for IE - onload should be used instead of load
  • Loading branch information
jnicklas committed Nov 29, 2011
2 parents 80d9e57 + 61758d6 commit 789b814
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/evergreen/views/run.erb
Expand Up @@ -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.