This commit is contained in:
2020-06-16 13:39:21 +00:00
parent e09ed207d9
commit a41cf17fc7
3 changed files with 96 additions and 41 deletions

View File

@@ -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