mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 19:17:27 +00:00
Make debounce delay explicit
This commit is contained in:
parent
9d7a19d624
commit
234384d3a7
2 changed files with 4 additions and 3 deletions
|
@ -171,11 +171,12 @@
|
||||||
require: "ngModel",
|
require: "ngModel",
|
||||||
scope: {
|
scope: {
|
||||||
"ngModel": "=",
|
"ngModel": "=",
|
||||||
"debounceModel": "="
|
"debounceModel": "=",
|
||||||
|
"debounceDelay": "@"
|
||||||
},
|
},
|
||||||
link: function (scope, element, attrs, ngModel) {
|
link: function (scope, element, attrs, ngModel) {
|
||||||
//jshint unused: false
|
//jshint unused: false
|
||||||
var delay = 250;
|
var delay = parseInt(scope.debounceDelay, 10) || 250;
|
||||||
var copyValue;
|
var copyValue;
|
||||||
scope.$watch(function() {
|
scope.$watch(function() {
|
||||||
return ngModel.$modelValue;
|
return ngModel.$modelValue;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<small ng-show="totalDownloads">(<span ng-bind="totalDownloads"></span> downloads to date)</small>
|
<small ng-show="totalDownloads">(<span ng-bind="totalDownloads"></span> downloads to date)</small>
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p>
|
||||||
<input type="text" ng-model="enteredSearchTerms" debounce-model="searchTerms" placeholder="Enter filter terms" autofocus>
|
<input type="text" ng-model="enteredSearchTerms" debounce-model="searchTerms" debounce-delay="250" placeholder="Enter filter terms" autofocus>
|
||||||
<span class="muted"> <ng-pluralize when="{1: '1 match', 'other': '{} matches'}" count="(packages | filter:packageMatcher(searchTerms)).length"/></span>
|
<span class="muted"> <ng-pluralize when="{1: '1 match', 'other': '{} matches'}" count="(packages | filter:packageMatcher(searchTerms)).length"/></span>
|
||||||
</p>
|
</p>
|
||||||
<table id="package-list" class="table table-bordered table-responsive table-hover">
|
<table id="package-list" class="table table-bordered table-responsive table-hover">
|
||||||
|
|
Loading…
Reference in a new issue