This commit is contained in:
@@ -111,49 +111,51 @@ Vue.config.productionTip = false;
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// AJAX LOADER INDICATOR
|
||||
//
|
||||
//
|
||||
|
||||
// Store a copy of the fetch function
|
||||
// let _oldFetch = fetch;
|
||||
let _oldFetch = fetch;
|
||||
|
||||
// // Create our new version of the fetch function
|
||||
// window.fetch = function() {
|
||||
// // Create hooks
|
||||
// let fetchStart = new Event("fetchStart", {
|
||||
// view: document,
|
||||
// bubbles: true,
|
||||
// cancelable: false
|
||||
// });
|
||||
// let fetchEnd = new Event("fetchEnd", {
|
||||
// view: document,
|
||||
// bubbles: true,
|
||||
// cancelable: false
|
||||
// });
|
||||
// Create our new version of the fetch function
|
||||
window.fetch = function() {
|
||||
// Create hooks
|
||||
let fetchStart = new Event("fetchStart", {
|
||||
view: document,
|
||||
bubbles: true,
|
||||
cancelable: false
|
||||
});
|
||||
let fetchEnd = new Event("fetchEnd", {
|
||||
view: document,
|
||||
bubbles: true,
|
||||
cancelable: false
|
||||
});
|
||||
|
||||
// // Pass the supplied arguments to the real fetch function
|
||||
// let fetchCall = _oldFetch.apply(this, arguments);
|
||||
// Pass the supplied arguments to the real fetch function
|
||||
let fetchCall = _oldFetch.apply(this, arguments);
|
||||
|
||||
// // Trigger the fetchStart event
|
||||
// document.dispatchEvent(fetchStart);
|
||||
// Trigger the fetchStart event
|
||||
document.dispatchEvent(fetchStart);
|
||||
|
||||
// fetchCall
|
||||
// .then(function() {
|
||||
// // Trigger the fetchEnd event
|
||||
// document.dispatchEvent(fetchEnd);
|
||||
// })
|
||||
// .catch(function() {
|
||||
// // Trigger the fetchEnd event
|
||||
// document.dispatchEvent(fetchEnd);
|
||||
// });
|
||||
fetchCall
|
||||
.then(function() {
|
||||
// Trigger the fetchEnd event
|
||||
document.dispatchEvent(fetchEnd);
|
||||
})
|
||||
.catch(function() {
|
||||
// Trigger the fetchEnd event
|
||||
document.dispatchEvent(fetchEnd);
|
||||
});
|
||||
|
||||
// return fetchCall;
|
||||
// };
|
||||
return fetchCall;
|
||||
};
|
||||
|
||||
// document.addEventListener("fetchStart", function() {
|
||||
// NProgress.start();
|
||||
// });
|
||||
document.addEventListener("fetchStart", function() {
|
||||
NProgress.start();
|
||||
});
|
||||
|
||||
// document.addEventListener("fetchEnd", function() {
|
||||
// NProgress.done();
|
||||
// });
|
||||
document.addEventListener("fetchEnd", function() {
|
||||
NProgress.done();
|
||||
});
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// FILTERS
|
||||
|
||||
Reference in New Issue
Block a user