Show a loading spinner while we're waiting for subscription information.
This commit is contained in:
parent
755fc168af
commit
c7e83c4d41
3 changed files with 11 additions and 1 deletions
|
@ -445,10 +445,16 @@ function UserAdminCtrl($scope, Restangular) {
|
||||||
planDict[$scope.plans[i].stripeId] = $scope.plans[i];
|
planDict[$scope.plans[i].stripeId] = $scope.plans[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('.spin').spin();
|
||||||
|
|
||||||
|
$scope.loading = true;
|
||||||
var getSubscription = Restangular.one('user/plan');
|
var getSubscription = Restangular.one('user/plan');
|
||||||
getSubscription.get().then(function(sub) {
|
getSubscription.get().then(function(sub) {
|
||||||
// User has a subscription
|
// User has a subscription
|
||||||
$scope.subscription = sub;
|
$scope.subscription = sub;
|
||||||
|
$scope.loading = false;
|
||||||
|
}, function() {
|
||||||
|
$scope.loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.subscribe = function(planId) {
|
$scope.subscribe = function(planId) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row" ng-hide="loading">
|
||||||
<div class="col-md-4" ng-repeat='plan in plans'>
|
<div class="col-md-4" ng-repeat='plan in plans'>
|
||||||
<div class="panel" ng-class="{'panel-success': subscription.plan == plan.stripeId, 'panel-default': subscription.plan != plan.stripeId}">
|
<div class="panel" ng-class="{'panel-success': subscription.plan == plan.stripeId, 'panel-default': subscription.plan != plan.stripeId}">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
|
@ -18,4 +18,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="loading" ng-show="loading">
|
||||||
|
<div class="spin"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -70,6 +70,7 @@
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="#/user">User Settings</a></li>
|
||||||
<li><a href="/signout">Sign out</a></li>
|
<li><a href="/signout">Sign out</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
Reference in a new issue