commit
43bd8b93ce
|
@ -26,7 +26,7 @@ toggleText = @.taiga.toggleText
|
||||||
scopeDefer = @.taiga.scopeDefer
|
scopeDefer = @.taiga.scopeDefer
|
||||||
bindOnce = @.taiga.bindOnce
|
bindOnce = @.taiga.bindOnce
|
||||||
groupBy = @.taiga.groupBy
|
groupBy = @.taiga.groupBy
|
||||||
debounce = @.taiga.debounce
|
debounceLeading = @.taiga.debounceLeading
|
||||||
|
|
||||||
|
|
||||||
module = angular.module("taigaBacklog")
|
module = angular.module("taigaBacklog")
|
||||||
|
@ -130,7 +130,7 @@ BacklogFiltersDirective = ($log, $location) ->
|
||||||
|
|
||||||
$ctrl.loadUserstories()
|
$ctrl.loadUserstories()
|
||||||
|
|
||||||
selectQFilter = debounce 400, (value) ->
|
selectQFilter = debounceLeading 100, (value) ->
|
||||||
return if value is undefined
|
return if value is undefined
|
||||||
if value.length == 0
|
if value.length == 0
|
||||||
$ctrl.replaceFilter("q", null)
|
$ctrl.replaceFilter("q", null)
|
||||||
|
|
|
@ -27,7 +27,7 @@ toString = @.taiga.toString
|
||||||
joinStr = @.taiga.joinStr
|
joinStr = @.taiga.joinStr
|
||||||
groupBy = @.taiga.groupBy
|
groupBy = @.taiga.groupBy
|
||||||
bindOnce = @.taiga.bindOnce
|
bindOnce = @.taiga.bindOnce
|
||||||
debounce = @.taiga.debounce
|
debounceLeading = @.taiga.debounceLeading
|
||||||
startswith = @.taiga.startswith
|
startswith = @.taiga.startswith
|
||||||
|
|
||||||
module = angular.module("taigaIssues")
|
module = angular.module("taigaIssues")
|
||||||
|
@ -577,7 +577,7 @@ IssuesFiltersDirective = ($log, $location, $rs, $confirm, $loading) ->
|
||||||
$scope.$on "filters:loaded", (ctx, filters) ->
|
$scope.$on "filters:loaded", (ctx, filters) ->
|
||||||
initializeSelectedFilters(filters)
|
initializeSelectedFilters(filters)
|
||||||
|
|
||||||
selectQFilter = debounce 400, (value) ->
|
selectQFilter = debounceLeading 100, (value) ->
|
||||||
return if value is undefined
|
return if value is undefined
|
||||||
if value.length == 0
|
if value.length == 0
|
||||||
$ctrl.replaceFilter("q", null)
|
$ctrl.replaceFilter("q", null)
|
||||||
|
|
|
@ -24,7 +24,7 @@ taiga = @.taiga
|
||||||
groupBy = @.taiga.groupBy
|
groupBy = @.taiga.groupBy
|
||||||
bindOnce = @.taiga.bindOnce
|
bindOnce = @.taiga.bindOnce
|
||||||
mixOf = @.taiga.mixOf
|
mixOf = @.taiga.mixOf
|
||||||
debounce = @.taiga.debounce
|
debounceLeading = @.taiga.debounceLeading
|
||||||
trim = @.taiga.trim
|
trim = @.taiga.trim
|
||||||
|
|
||||||
module = angular.module("taigaSearch", [])
|
module = angular.module("taigaSearch", [])
|
||||||
|
@ -63,7 +63,7 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
|
|
||||||
# Search input watcher
|
# Search input watcher
|
||||||
@scope.searchTerm = ""
|
@scope.searchTerm = ""
|
||||||
loadSearchData = debounce(200, (t) => @.loadSearchData(t))
|
loadSearchData = debounceLeading(100, (t) => @.loadSearchData(t))
|
||||||
|
|
||||||
@scope.$watch "searchTerm", (term) =>
|
@scope.$watch "searchTerm", (term) =>
|
||||||
if not term
|
if not term
|
||||||
|
|
|
@ -106,6 +106,9 @@ joinStr = (str, coll) ->
|
||||||
debounce = (wait, func) ->
|
debounce = (wait, func) ->
|
||||||
return _.debounce(func, wait, {leading: true, trailing: false})
|
return _.debounce(func, wait, {leading: true, trailing: false})
|
||||||
|
|
||||||
|
debounceLeading = (wait, func) ->
|
||||||
|
return _.debounce(func, wait, {leading: false, trailing: true})
|
||||||
|
|
||||||
startswith = (str1, str2) ->
|
startswith = (str1, str2) ->
|
||||||
return _.str.startsWith(str1, str2)
|
return _.str.startsWith(str1, str2)
|
||||||
|
|
||||||
|
@ -140,5 +143,6 @@ taiga.scopeDefer = scopeDefer
|
||||||
taiga.toString = toString
|
taiga.toString = toString
|
||||||
taiga.joinStr = joinStr
|
taiga.joinStr = joinStr
|
||||||
taiga.debounce = debounce
|
taiga.debounce = debounce
|
||||||
|
taiga.debounceLeading = debounceLeading
|
||||||
taiga.startswith = startswith
|
taiga.startswith = startswith
|
||||||
taiga.sizeFormat = sizeFormat
|
taiga.sizeFormat = sizeFormat
|
||||||
|
|
Loading…
Reference in New Issue