Browse Source

Fix ajax interceptor

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
adde2a013a
  1. 18
      view-mode/function/ganttConfig.js

18
view-mode/function/ganttConfig.js

@ -21,7 +21,9 @@ const axiosInstance = axios.create({
axiosInstance.interceptors.request.use(async (config) => {
try{
if (config.url !== `${base_url}project/s-curve-command`) {
$("body").addClass("loading");
}
}
catch(e)
{
@ -34,7 +36,9 @@ axiosInstance.interceptors.request.use(async (config) => {
axiosInstance.interceptors.response.use(async (config) => {
try {
if (config.url !== `${base_url}project/s-curve-command`) {
$("body").removeClass("loading");
}
}
catch(e)
{
@ -60,11 +64,17 @@ $.ajaxSetup({
}
});
$(document).on({
ajaxStart: function(){
$(document).ajaxStart(function(event) {
var url = event.target.URL;
if (url !== `${base_url}project/s-curve-command`) {
$("body").addClass("loading");
},
ajaxStop: function(){
}
});
$(document).ajaxComplete(function(event) {
var url = event.target.URL;
if (url !== `${base_url}project/s-curve-command`) {
$("body").removeClass("loading");
}
});

Loading…
Cancel
Save