Skip to content

Commit f6b44a7

Browse files
committed
fix ready event
1 parent 6d209ad commit f6b44a7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/jquery-ias.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@
487487

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

490+
// ready is already fired, before on() could even be called, so
491+
// let's call the callback right away
492+
if (event === 'ready' && this.isInitialized) {
493+
$.proxy(callback, this)();
494+
}
495+
490496
return this;
491497
};
492498

test/08-auto-initialize-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe("IAS", function () {
1+
describe("auto initialize", function () {
22
before(function() {
33
this.timeout = 10000;
44

0 commit comments

Comments
 (0)