From 72e9cfdab272e24030117025c0000884a0e5ad7f Mon Sep 17 00:00:00 2001 From: Richcard Ho Date: Thu, 26 May 2016 18:44:40 +1000 Subject: [PATCH] loading spinner while searching (#41) * loading spinner while searching * initialize $scope.loading = false * ng-src - > src --- css/player.css | 5 +++++ js/app.js | 11 ++++++++--- listen1.html | 5 +++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/css/player.css b/css/player.css index 11acbda..115ff9f 100644 --- a/css/player.css +++ b/css/player.css @@ -116,6 +116,11 @@ a { margin-top: 12px; } +.searchbox .nav .searchspinner{ + margin-top: 8px; + height: 25px; +} + .searchitem { height: 92px; diff --git a/js/app.js b/js/app.js index 7a738cc..71b2182 100644 --- a/js/app.js +++ b/js/app.js @@ -719,13 +719,16 @@ function($scope, $http, $timeout, angularPlayer, loWeb) { $scope.tab = 0; $scope.keywords = ''; + $scope.loading = false; $scope.changeTab = function(newTab){ + $scope.loading = true; $scope.tab = newTab; $scope.result = []; loWeb.get('/search?source=' + getSourceName($scope.tab) + '&keywords=' + $scope.keywords).success(function(data) { // update the textarea - $scope.result = data.result; + $scope.result = data.result; + $scope.loading = false; }); }; @@ -741,10 +744,12 @@ // if searchStr is still the same.. // go ahead and retrieve the data if (tmpStr === $scope.keywords) - { + { + $scope.loading = true; loWeb.get('/search?source=' + getSourceName($scope.tab) + '&keywords=' + $scope.keywords).success(function(data) { // update the textarea - $scope.result = data.result; + $scope.result = data.result; + $scope.loading = false; }); } }); diff --git a/listen1.html b/listen1.html index 3e43723..88e09aa 100644 --- a/listen1.html +++ b/listen1.html @@ -188,13 +188,14 @@ + -