Skip to content

Commit 86d1998

Browse files
committed
allow to specify the search throttle time
1 parent e686128 commit 86d1998

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* fixed browser back behaviour when removing queries, pull request #23
1010
* add option to configure the suggested parameter label text
1111
* allow to specify the display limit of search parameter suggestions
12+
* allow to specify the search throttle time
1213

1314
### 1.1.1 - 03 February 2015
1415
* update README with latest changes to dist files in bower package

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ param can be a scope variable as well as a hard-coded string.
9898
</tr>
9999
<tr>
100100
<td>placeholder</td>
101-
<td>specifies a short hint in the search box</td>
101+
<td>Specifies a short hint in the search box</td>
102+
</tr>
103+
<tr>
104+
<td>searchThrottleTime</td>
105+
<td>Specifies the time in milliseconds to wait for changes in the ui until the ng-model is updated. Default is 1000ms.</td>
102106
</tr>
103107
</tbody>
104108
</table>

src/angular-advanced-searchbox.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ angular.module('angular-advanced-searchbox', [])
1919
parameters: '=',
2020
parametersLabel: '@',
2121
parametersDisplayLimit: '=',
22-
placeholder: '@'
22+
placeholder: '@',
23+
searchThrottleTime: '='
2324
},
2425
replace: true,
2526
templateUrl: 'angular-advanced-searchbox.html',
@@ -30,6 +31,7 @@ angular.module('angular-advanced-searchbox', [])
3031
$scope.parametersLabel = $scope.parametersLabel || 'Parameter Suggestions';
3132
$scope.parametersDisplayLimit = $scope.parametersDisplayLimit || 8;
3233
$scope.placeholder = $scope.placeholder || 'Search ...';
34+
$scope.searchThrottleTime = $scope.searchThrottleTime || 1000;
3335
$scope.searchParams = [];
3436
$scope.searchQuery = '';
3537
$scope.setSearchFocus = false;
@@ -245,7 +247,7 @@ angular.module('angular-advanced-searchbox', [])
245247
});
246248

247249
changeBuffer.length = 0;
248-
}, 500);
250+
}, $scope.searchThrottleTime);
249251
}
250252

251253
function getCurrentCaretPosition(input) {

0 commit comments

Comments
 (0)