Limit spamming the server with lots of requests

This uses "debounce" to add a little waiting time whilst the user is part-way through selecting dates (or manually typing in the date filter) so we don't make too many unnecessary requests.
This commit is contained in:
Matt-Yorkley
2020-03-28 11:18:07 +01:00
parent b76a6d15a3
commit d568b45d4a

View File

@@ -20,12 +20,12 @@
%label{ :for => 'start_date_filter' }
= t("admin.start_date")
%br
%input{ :class => "two columns alpha", :type => "text", :id => 'start_date_filter', 'ng-model' => 'startDate', 'datepicker' => "startDate", 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()' }
%input{ :class => "two columns alpha", :type => "text", :id => 'start_date_filter', 'ng-model' => 'startDate', 'datepicker' => "startDate", 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()', 'ng-model-options' => '{ debounce: 1000 }' }
.date_filter{ :class => "two columns" }
%label{ :for => 'end_date_filter' }
= t("admin.end_date")
%br
%input{ :class => "two columns alpha", :type => "text", :id => 'end_date_filter', 'ng-model' => 'endDate', 'datepicker' => "endDate", 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()' }
%input{ :class => "two columns alpha", :type => "text", :id => 'end_date_filter', 'ng-model' => 'endDate', 'datepicker' => "endDate", 'confirm-change' => "confirmRefresh()", 'ng-change' => 'refreshData()', 'ng-model-options' => '{ debounce: 1000 }' }
.one.column  
.filter_select{ :class => "three columns" }
%label{ :for => 'supplier_filter' }