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