From f06d0c2a6f4f23c0ee9970e91b1be0bcbe34e39c Mon Sep 17 00:00:00 2001 From: Felipe Bormann Date: Thu, 1 Jun 2017 21:24:29 -0300 Subject: [PATCH] transfered update cycle to click of a button and introduced disabled routine --- dashboards/static/dashboards/js/logbehavior.js | 17 ++++++++++++----- dashboards/templates/dashboards/log.html | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dashboards/static/dashboards/js/logbehavior.js b/dashboards/static/dashboards/js/logbehavior.js index 4c0e924..b1bf3b8 100644 --- a/dashboards/static/dashboards/js/logbehavior.js +++ b/dashboards/static/dashboards/js/logbehavior.js @@ -10,19 +10,26 @@ $(document).ready(function(){ }); $("#init_date").on("dp.change", function (e) { $('#end_date').data("DateTimePicker").minDate(e.date); - end_date = $("#end_date").data("DateTimePicker").date(); - log.refresh_log_data(e.date, end_date); + $('#search').removeClass("disabled"); }); $("#end_date").on("dp.change", function (e) { $('#init_date').data("DateTimePicker").maxDate(e.date); - //when the user updates the second one we build the log table - init_date = $("#init_date").data("DateTimePicker").date(); - log.refresh_log_data(init_date, e.date); + $('#search').removeClass("disabled"); }); //initialize the table with log from last 30 days init_date = $("#init_date").data("DateTimePicker").date(); end_date = $("#end_date").data("DateTimePicker").date(); log.refresh_log_data(init_date, end_date); + + $("#search").click(function(){ + if (!$("#search").hasClass("disabled")){ + init_date = $("#init_date").data("DateTimePicker").date(); + end_date = $("#end_date").data("DateTimePicker").date(); + log.refresh_log_data(init_date, end_date); + $('#search').addClass("disabled"); + } + + }); }); diff --git a/dashboards/templates/dashboards/log.html b/dashboards/templates/dashboards/log.html index 887d5f7..a242e10 100644 --- a/dashboards/templates/dashboards/log.html +++ b/dashboards/templates/dashboards/log.html @@ -25,7 +25,7 @@ - +

{% trans "Amadeus Report" %}

-- libgit2 0.21.2