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 @@
-
+