#1: Improved visual feedback that a search is in progress.

This commit is contained in:
Peter Deltchev 2016-01-20 22:06:52 -08:00
parent 4585eb712e
commit d73a0d006d
2 changed files with 9 additions and 5 deletions

View file

@ -8,15 +8,14 @@
/>
<section class="search-results pfm-popup" id="search-results">
<div ng-hide="searchInProgress">
<p class="empty-box">Type something to begin searching!</p>
</div>
<p ng-show="!searchInProgress && !searchComplete" class="empty-box">Type something to begin searching!</p>
<div ng-show="searchInProgress">
<p ng-show="searchInProgress" class="empty-box">Searching&hellip;</p>
<div ng-show="!searchInProgress && searchComplete">
<div class="-column1">
<h3 class="-section-header">Matching tracks</h3>
<pfm-tracks-list tracks="tracks"></pfm-tracks-list>
</div>
<div class="-column2">

View file

@ -26,6 +26,7 @@ angular.module('ponyfm').directive 'pfmSearch', () ->
($scope, search) ->
$scope.searchQuery = ''
$scope.searchInProgress = false
$scope.searchComplete = false
$scope.tracks = []
$scope.albums = []
@ -44,6 +45,7 @@ angular.module('ponyfm').directive 'pfmSearch', () ->
if searchQuery.length <3
clearResults()
$scope.searchInProgress = false
$scope.searchComplete = false
return
$scope.searchInProgress = true
@ -51,6 +53,9 @@ angular.module('ponyfm').directive 'pfmSearch', () ->
search.searchAllContent(searchQuery)
.then (results)->
clearResults()
$scope.searchInProgress = false
$scope.searchComplete = true
for track in results.tracks
$scope.tracks.push(track)