mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 09:31:16 -03:00
Add a one second delay between query input and filtering history
This commit is contained in:
@@ -216,6 +216,17 @@ controllers.controller("historyController", function($scope, $http, $timeout) {
|
||||
$scope.historyItems.splice(index, 1);
|
||||
})};
|
||||
|
||||
var queryInputTimeout = null;
|
||||
$scope.$watch("queryInput", function() {
|
||||
if (queryInputTimeout){
|
||||
$timeout.cancel(queryInputTimeout);
|
||||
}
|
||||
|
||||
queryInputTimeout = $timeout(function() {
|
||||
$scope.query = $scope.queryInput;
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
$scope.fetchHistory();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user