[pmg-devel] [PATCH pmg-gui 2/4] MailTracker: buffer onFilterChange

Dominik Csapak d.csapak at proxmox.com
Fri Apr 24 15:57:54 CEST 2020


so that the store gets loaded only when the user stops typing

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/MailTracker.js | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/js/MailTracker.js b/js/MailTracker.js
index 23f7413..9a6774b 100644
--- a/js/MailTracker.js
+++ b/js/MailTracker.js
@@ -99,7 +99,12 @@ Ext.define('PMG.MailTrackerFilter', {
 		{
 		    fieldLabel: gettext('Start'),
 		    reference: 'starttime',
-		    listeners: { change: 'onFilterChange' },
+		    listeners: {
+			change: {
+			    fn: 'onFilterChange',
+			    buffer: 500,
+			},
+		    },
 		    value: (function() {
 			var now = new Date();
 			return new Date(now.getTime() - 3600000);
@@ -118,7 +123,12 @@ Ext.define('PMG.MailTrackerFilter', {
 		{
 		    fieldLabel: gettext('End'),
 		    reference: 'endtime',
-		    listeners: { change: 'onFilterChange' },
+		    listeners: {
+			change: {
+			    fn: 'onFilterChange',
+			    buffer: 500,
+			},
+		    },
 		    value: (function() {
 			var now = new Date();
 			var tomorrow = new Date();
-- 
2.20.1




More information about the pmg-devel mailing list