-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.js
More file actions
33 lines (28 loc) · 1.26 KB
/
Copy pathloader.js
File metadata and controls
33 lines (28 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if (!window.Que) {
window._QuStartTime = performance.now();
(function () {
var bus = (window.Qu && window.Qu.bus) || document;
var originalDispatch = bus.dispatchEvent;
var fired = window._QueFired || (window._QueFired = {});
var queue = window._QueQ || (window._QueQ = []);
var details = window._QueDetails || (window._QueDetails = Object.create(null));
bus.dispatchEvent = function (event) {
if (event && event.type) {
fired[event.type] = (fired[event.type] || 0) + 1;
if (event.detail !== undefined) {
details[event.type] = event.detail;
if (window.Qu && typeof window.Qu._touchEventCache === 'function') {
window.Qu._touchEventCache(event.type, event.detail);
}
}
}
return originalDispatch.call(bus, event);
};
window.Que = function (callback, ev, onceOrOptions, mode, useCache) {
if (window.Qu && typeof window.Qu.when === 'function') {
return window.Qu.when(callback, ev, onceOrOptions, mode, useCache);
}
queue.push([callback, ev, onceOrOptions, mode, useCache]);
};
})();
}