Merge pull request #551 from taigaio/issue/2803/search-result-loading
add loader in the search result pagestable
commit
9836553d57
|
@ -98,7 +98,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
{
|
||||
templateUrl: "search/search.html",
|
||||
reloadOnSearch: false,
|
||||
section: "search"
|
||||
section: "search",
|
||||
loader: true
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -36,3 +36,17 @@ class TgLoadingService extends taiga.Service
|
|||
target.removeClass('loading')
|
||||
|
||||
module.service("$tgLoading", TgLoadingService)
|
||||
|
||||
LoadingDirective = ($loading) ->
|
||||
link = ($scope, $el, attr) ->
|
||||
$scope.$watch attr.tgLoading, (showLoading) =>
|
||||
if showLoading
|
||||
$loading.start($el)
|
||||
else
|
||||
$loading.finish($el)
|
||||
|
||||
return {
|
||||
link:link
|
||||
}
|
||||
|
||||
module.directive("tgLoading", ["$tgLoading", LoadingDirective])
|
||||
|
|
|
@ -69,7 +69,10 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
@scope.$watch "searchTerm", (term) =>
|
||||
if term
|
||||
loadSearchData(term)
|
||||
@scope.loading = true
|
||||
|
||||
@.loadSearchData(term).then () =>
|
||||
@scope.loading = false
|
||||
|
||||
loadFilters: ->
|
||||
defered = @q.defer()
|
||||
|
|
|
@ -2,4 +2,5 @@ section.search-in
|
|||
header
|
||||
fieldset
|
||||
input(type="text", placeholder="{{'SEARCH.PLACEHOLDER_SEARCH' | translate}}", ng-model="searchTerm")
|
||||
a.icon.icon-search(href="", title="{{'SEARCH.TITLE_ACTION_SEARCH' | translate}}")
|
||||
.icon-search-wrapper(tg-loading="loading")
|
||||
a.icon.icon-search(href="", title="{{'SEARCH.TITLE_ACTION_SEARCH' | translate}}")
|
||||
|
|
|
@ -6,10 +6,15 @@
|
|||
color: $gray-light;
|
||||
}
|
||||
}
|
||||
.icon-search {
|
||||
color: $gray-light;
|
||||
.icon-search-wrapper {
|
||||
position: absolute;
|
||||
right: .7rem;
|
||||
top: .7rem;
|
||||
}
|
||||
.icon-search {
|
||||
color: $gray-light;
|
||||
}
|
||||
.loading-spinner {
|
||||
margin-top: .1rem;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue