mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #5643 from gabrielbazan7/fix/flickerAB
fix add icon flicker in addressbook view
This commit is contained in:
commit
5cc03497de
|
@ -3,7 +3,6 @@
|
|||
angular.module('copayApp.controllers').controller('addressbookListController', function($scope, $log, $timeout, addressbookService, lodash, popupService, gettextCatalog, platformInfo) {
|
||||
|
||||
var contacts;
|
||||
$scope.isChromeApp = platformInfo.isChromeApp;
|
||||
|
||||
var initAddressbook = function() {
|
||||
addressbookService.list(function(err, ab) {
|
||||
|
@ -11,6 +10,9 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
|
|||
|
||||
$scope.isEmptyList = lodash.isEmpty(ab);
|
||||
|
||||
if (!$scope.isEmptyList) $scope.showAddIcon = true;
|
||||
else $scope.showAddIcon = false;
|
||||
|
||||
contacts = [];
|
||||
lodash.each(ab, function(v, k) {
|
||||
contacts.push({
|
||||
|
@ -23,7 +25,7 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
|
|||
$scope.addressbook = lodash.clone(contacts);
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -58,6 +60,8 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
|
|||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.isChromeApp = platformInfo.isChromeApp;
|
||||
$scope.showAddIcon = false;
|
||||
initAddressbook();
|
||||
});
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
<span translate>Address Book</span>
|
||||
</ion-nav-title>
|
||||
<ion-nav-buttons side="secondary">
|
||||
<button class="button button-back button-clear ng-hide" ng-show="!isEmptyList" ui-sref="tabs.addressbook.add">
|
||||
<button class="button button-back button-clear ng-hide" ng-show="showAddIcon" ui-sref="tabs.addressbook.add">
|
||||
<i class="icon ion-ios-plus-empty"></i>
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
</ion-nav-bar>
|
||||
<ion-content scroll="false" id="add-address" class="ng-hide" ng-show="isEmptyList">
|
||||
<ion-content scroll="false" id="add-address" ng-show="isEmptyList">
|
||||
<div class="zero-state">
|
||||
<i class="icon zero-state-icon">
|
||||
<img src="img/address-book-add.svg"/>
|
||||
|
@ -23,8 +23,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-content class="ng-hide" ng-show="!isEmptyList">
|
||||
<div class="bar bar-header item-input-inset" ng-show="!isEmptyList && addressbook.length >= 5">
|
||||
<ion-content ng-show="!isEmptyList">
|
||||
<div class="bar bar-header item-input-inset" ng-show="addressbook.length >= 5">
|
||||
<label class="item-input-wrapper">
|
||||
<i class="icon ion-ios-search placeholder-icon"></i>
|
||||
<input type="search"
|
||||
|
|
Loading…
Reference in New Issue