pull to refresh in home tab

This commit is contained in:
Gabriel Bazán 2016-10-11 12:59:02 -03:00
commit c73fb0173c
2 changed files with 18 additions and 6 deletions

View file

@ -11,9 +11,10 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.version = $window.version;
$scope.name = $window.appConfig.nameCase;
$scope.homeTip = $stateParams.fromOnboarding;
$scope.isCordova = platformInfo.isCordova;
if(!$scope.homeTip){
storageService.getHomeTipAccepted(function(error, value){
if (!$scope.homeTip) {
storageService.getHomeTipAccepted(function(error, value) {
$scope.homeTip = (value == 'false') ? false : true;
});
}
@ -170,7 +171,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
};
$scope.hideHomeTip = function() {
storageService.setHomeTipAccepted(false, function(error, value){
storageService.setHomeTipAccepted(false, function(error, value) {
$scope.homeTip = false;
});
};
@ -201,6 +202,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
});
};
$scope.onRefresh = function() {
$scope.$broadcast('scroll.refreshComplete');
updateAllWallets();
};
$scope.$on("$ionicView.enter", function(event, data) {
$scope.bitpayCard = null;
nextStep();

View file

@ -4,6 +4,12 @@
</ion-nav-bar>
<ion-content class="padding">
<ion-refresher
ng-if="isCordova"
pulling-icon="ion-ios-refresh"
spinner="ios-small"
on-refresh="onRefresh()">
</ion-refresher>
<div class="list card homeTip" ng-if="homeTip">
<div class="item item-icon-right item-heading">
<a ng-click="hideHomeTip()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>