Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

attachEvent fixed for IE - onload should be used instead of load #41

Merged
merged 1 commit into from

2 participants

@gregolsen

In context of #40

It's a small fix for IE, because while using attachEvent one should use 'onload' event instead of 'load' (for other browsers).

@jnicklas jnicklas merged commit 789b814 into from
@jnicklas
Collaborator

Thanks so much for this fix. Should have known that IE compatibility couldn't have been that easy :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/evergreen/views/run.erb
View
11 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>
Something went wrong with that request. Please try again.