chore(jqLite): remove the ready handlers instead of setting a flag

This change aligns jqLite with the jQuery implementation.

Closes #15237
This commit is contained in:
Michał Gołębiowski
2016-10-12 14:41:53 +02:00
parent e008df6c8c
commit beab3baec3
+2 -4
View File
@@ -522,11 +522,9 @@ function jqLiteDocumentLoaded(action, win) {
}
function jqLiteReady(fn) {
var fired = false;
function trigger() {
if (fired) return;
fired = true;
window.document.removeEventListener('DOMContentLoaded', trigger);
window.removeEventListener('load', trigger);
fn();
}