FSN#40710 clearTimeout cleared nu alle (ajax) timeouts zodat hij er geen vergeet
svn path=/Website/trunk/; revision=34416
This commit is contained in:
@@ -97,7 +97,7 @@ function gen_cancel()
|
||||
FcltMgr.closeDetail(window, { cancel: true } );
|
||||
}
|
||||
|
||||
var busyOverlay, busyLoading;
|
||||
var ajaxBusy = [];
|
||||
|
||||
// TODO Alleen als Logging aan?
|
||||
$.ajaxSetup(
|
||||
@@ -128,47 +128,53 @@ $.ajaxSetup(
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxSend(function (event, xhr, options) {
|
||||
$(document).on("ajaxSend", function (event, xhr, options) {
|
||||
|
||||
if (options.type.toUpperCase() === "POST")
|
||||
{
|
||||
var $body = $("body");
|
||||
busyOverlay = setTimeout(function () {
|
||||
if (window.location.href.match(/empty\.asp|empty\.html/ig))
|
||||
{
|
||||
if (!$body.find("div.busyloading").length)
|
||||
{
|
||||
var w = Math.max(0, $(window).width() - 62);
|
||||
$body.prepend("<div style='left:"+(w/2)+"px' class='busyloading'><i class='fa fa-spinner fa-pulse fa-4x fa-fw'></i></div>");
|
||||
}
|
||||
}
|
||||
else if (!$body.find("div.busyoverlay").length)
|
||||
{
|
||||
var wrapper = "<div class='busyoverlay'></div>";
|
||||
$body.contents().wrap(wrapper);
|
||||
}
|
||||
}, 500);
|
||||
if (options.type.toUpperCase() === "POST")
|
||||
{
|
||||
|
||||
busyLoading = setTimeout(function () {
|
||||
if (!$body.find("div.busyloading").length)
|
||||
{
|
||||
var w = Math.max(0, $(window).width() - 62);
|
||||
$body.prepend("<div style='left:"+(w/2)+"px' class='busyloading'><i class='fa fa-spinner fa-pulse fa-4x fa-fw'></i></div>");
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
var $body = $("body");
|
||||
var ajaxSend = setTimeout(function () {
|
||||
if (window.location.href.match(/empty\.asp|empty\.html/ig))
|
||||
{
|
||||
if (!$body.find("div.busyloading").length)
|
||||
{
|
||||
var w = Math.max(0, $(window).width() - 62);
|
||||
$body.prepend("<div style='left:"+(w/2)+"px' class='busyloading'><i class='fa fa-spinner fa-pulse fa-4x fa-fw'></i></div>");
|
||||
}
|
||||
}
|
||||
else if (!$body.find("div.busyoverlay").length)
|
||||
{
|
||||
var wrapper = "<div class='busyoverlay'></div>";
|
||||
$body.contents().wrap(wrapper);
|
||||
}
|
||||
}, 500);
|
||||
window.ajaxBusy.push(ajaxSend);
|
||||
|
||||
}).ajaxComplete(function (event, xhr, options) {
|
||||
|
||||
if (options.type.toUpperCase() === "POST")
|
||||
{
|
||||
clearTimeout(busyOverlay);
|
||||
clearTimeout(busyLoading);
|
||||
if ($("div.busyoverlay").length)
|
||||
$("div.busyoverlay").contents().unwrap();
|
||||
$(".busyloading").remove();
|
||||
}
|
||||
});
|
||||
ajaxSend = setTimeout(function () {
|
||||
if (!$body.find("div.busyloading").length)
|
||||
{
|
||||
var w = Math.max(0, $(window).width() - 62);
|
||||
$body.prepend("<div style='left:"+(w/2)+"px' class='busyloading'><i class='fa fa-spinner fa-pulse fa-4x fa-fw'></i></div>");
|
||||
}
|
||||
}, 2000);
|
||||
window.ajaxBusy.push(ajaxSend);
|
||||
}
|
||||
|
||||
}).on("ajaxComplete", function (event, xhr, options) {
|
||||
if (options.type.toUpperCase() === "POST")
|
||||
{
|
||||
|
||||
for (var i = 0; i < window.ajaxBusy.length; i++) {
|
||||
clearTimeout(window.ajaxBusy[i]);
|
||||
}
|
||||
if ($("div.busyoverlay").length)
|
||||
$("div.busyoverlay").contents().unwrap();
|
||||
$(".busyloading").remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Experiment:
|
||||
// Ctrl+W sluit onze eigen tabjes ipv browser tabjes?
|
||||
|
||||
Reference in New Issue
Block a user