Commit 22065465 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

fix a bug with multiple ajax request

parent 7c96ccc1
......@@ -38,6 +38,9 @@ $(function () {
// statistics menu handling
$(':radio[id=select_cruser]').attr('checked','checked');
$(':radio[id=by_laboratories]').attr('checked','checked');
$(':checkbox').each(function(){
$(this).attr("checked", false);
});
$(':radio[id=distribution]').attr('checked','checked');
$(":radio[id^=by_]").change(function(){
var group_by = $(this).attr("id").split("_")[1];
......@@ -340,6 +343,7 @@ function projectDistributionHandler() {
}
function updateButtons () {
var nb_updated = 0;
$('.multiple-selection-btn').each(function(){
if ($("[type='checkbox']:checked").size() == 0) {
// Add tooltip
......@@ -350,15 +354,18 @@ function updateButtons () {
$(this).addClass("disabled").attr("rel", "tooltip");
$("#project_distribution").unbind("click", projectDistributionHandler);
$("#project_evolution").unbind("click", projectEvolutionHandler);
} else {
} else if ($(this).hasClass("disabled")) {
// Enable
$(this).removeClass("disabled").attr("rel", null);
// Remove tooltip
$(this).removeAttr('rel');
$(this).removeAttr('data-title');
$(this).tooltip('destroy');
$("#project_distribution").bind("click", projectDistributionHandler);
$("#project_evolution").bind("click", projectEvolutionHandler);
if (nb_updated == 0) {
$("#project_distribution").bind("click", projectDistributionHandler);
$("#project_evolution").bind("click", projectEvolutionHandler);
}
nb_updated += 1;
}
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment