Fixing searchs
parent
330ad999a6
commit
74cae6947e
|
@ -41,10 +41,11 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$location",
|
"$location",
|
||||||
"$appTitle"
|
"$appTitle",
|
||||||
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @repo, @rs, @params, @q, @location, @appTitle) ->
|
constructor: (@scope, @repo, @rs, @params, @q, @location, @appTitle, tgLoader) ->
|
||||||
@scope.sectionName = "Search"
|
@scope.sectionName = "Search"
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
|
@ -60,8 +61,10 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
loadSearchData = debounce(200, (t) => @.loadSearchData(t))
|
loadSearchData = debounce(200, (t) => @.loadSearchData(t))
|
||||||
|
|
||||||
@scope.$watch "searchTerm", (term) ->
|
@scope.$watch "searchTerm", (term) ->
|
||||||
return if not term
|
if not term
|
||||||
loadSearchData(term)
|
tgLoader.pageLoaded()
|
||||||
|
else
|
||||||
|
loadSearchData(term)
|
||||||
|
|
||||||
loadFilters: ->
|
loadFilters: ->
|
||||||
defered = @q.defer()
|
defered = @q.defer()
|
||||||
|
@ -83,6 +86,7 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
loadSearchData: (term) ->
|
loadSearchData: (term) ->
|
||||||
promise = @rs.search.do(@scope.projectId, term).then (data) =>
|
promise = @rs.search.do(@scope.projectId, term).then (data) =>
|
||||||
@scope.searchResults = data
|
@scope.searchResults = data
|
||||||
|
tgLoader.pageLoaded()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
return promise
|
return promise
|
||||||
|
|
Loading…
Reference in New Issue