mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
events.js: Don't search as long as the user is typing
500ms is for the average typist. Still fast enough, imho. refs #3348
This commit is contained in:
parent
b76e6e7597
commit
c2b3bbb87b
@ -13,6 +13,7 @@
|
||||
this.icinga = icinga;
|
||||
|
||||
this.searchValue = '';
|
||||
this.searchTimer = null;
|
||||
this.initializeModules = true;
|
||||
};
|
||||
|
||||
@ -213,7 +214,16 @@
|
||||
return;
|
||||
}
|
||||
_this.searchValue = $('#menu input.search').val();
|
||||
return _this.autoSubmitForm(event);
|
||||
|
||||
if (_this.searchTimer !== null) {
|
||||
clearTimeout(_this.searchTimer);
|
||||
_this.searchTimer = null;
|
||||
}
|
||||
var _event = $.extend({}, event); // event seems gc'd once the timeout is over
|
||||
_this.searchTimer = setTimeout(function () {
|
||||
_this.submitForm(_event, true);
|
||||
_this.searchTimer = null;
|
||||
}, 500);
|
||||
},
|
||||
|
||||
rememberSubmitButton: function(e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user