Improves the responsiveness and interactivity of historical exploration

Uses ajax to handle (possibly) long queries on historical data
with the aim of improving user experience.
The user is notified when a query is taking too long so that
he/she can get feedback of what is going on.
This commit is contained in:
Simone Mainardi 2016-10-31 15:56:11 +01:00
parent 0793d8666a
commit 8f87f11b26
4 changed files with 568 additions and 485 deletions

View file

@ -174,16 +174,23 @@ function drawTrend(current, last, withColor) {
}
}
function toggleAllTabs(enabled){
if(enabled === true)
$("#historical-tabs-container").find("li").removeClass("disabled").find("a").attr("data-toggle", "tab");
else
$("#historical-tabs-container").find("li").addClass("disabled").find("a").removeAttr("data-toggle");
}
function disableAllDropdownsAndTabs(){
$("select").each(function() {
$(this).prop("disabled", true);
});
$("#historical-tabs-container").find("li").addClass("disabled").find("a").removeAttr("data-toggle");
$("select").each(function() {
$(this).prop("disabled", true);
});
toggleAllTabs(false)
}
function enableAllDropdownsAndTabs(){
$("select").each(function() {
$(this).prop("disabled", false);
});
$("#historical-tabs-container").find("li").removeClass("disabled").find("a").attr("data-toggle", "tab");
$("select").each(function() {
$(this).prop("disabled", false);
});
toggleAllTabs(true)
}