Skip to content

Commit

Permalink
fix ready event
Browse files Browse the repository at this point in the history
  • Loading branch information
fieg committed Mar 14, 2018
1 parent 6d209ad commit f6b44a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/jquery-ias.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@

this.listeners[event].add($.proxy(callback, this), priority);

// ready is already fired, before on() could even be called, so
// let's call the callback right away
if (event === 'ready' && this.isInitialized) {
$.proxy(callback, this)();
}

return this;
};

Expand Down
2 changes: 1 addition & 1 deletion test/08-auto-initialize-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe("IAS", function () {
describe("auto initialize", function () {
before(function() {
this.timeout = 10000;

Expand Down

0 comments on commit f6b44a7

Please sign in to comment.