add timeout to resize and fix advanced settings

This commit is contained in:
Gabriel Bazán 2016-09-28 15:45:21 -03:00
parent 008eb310e1
commit 2fdd12a9c2
8 changed files with 26 additions and 18 deletions

View File

@ -33,7 +33,7 @@
</a>
</div>
<div class="list card" ng-if="notifications[0] && recentTransactions">
<div class="list card" ng-if="notifications[0] && recentTransactionsEnabled">
<a class="item item-icon-right item-heading" ui-sref="tabs.activity">
<span translate>Recent Transactions</span>
<i class="icon nav-item-arrow-right"></i>
@ -120,7 +120,7 @@
<i class="icon nav-item-arrow-down" ng-if="!hideNextSteps"></i>
<i class="icon nav-item-arrow-up" ng-if="hideNextSteps"></i>
</div>
<div ng-if="hideNextSteps">
<div ng-if="!hideNextSteps">
<a ng-if="!wallets[0]" ui-sref="tabs.add" class="item item-icon-left item-big-icon-left item-icon-right next-step">
<i class="icon big-icon-svg">
<div class="bg icon-create-wallet"></div>

View File

@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
$scope.coinbaseChange = function() {
var opts = {
coinbase: {
enabled: $scope.coinbaseEnabled
enabled: $scope.coinbaseEnabled.value
}
};
configService.set(opts, function(err) {
@ -87,7 +87,7 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
$scope.recentTransactionsChange = function() {
var opts = {
recentTransactions: {
enabled: $scope.recentTransactionsEnabled
enabled: $scope.recentTransactionsEnabled.value
}
};
configService.set(opts, function(err) {
@ -98,7 +98,7 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
$scope.frequentlyUsedChange = function() {
var opts = {
frequentlyUsed: {
enabled: $scope.frequentlyUsedEnabled
enabled: $scope.frequentlyUsedEnabled.value
}
};
configService.set(opts, function(err) {

View File

@ -71,7 +71,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
$timeout(function() {
$ionicScrollDelegate.resize();
}, 100);
}, 10);
});
$scope.toggleAlternative = function() {

View File

@ -37,7 +37,9 @@ angular.module('copayApp.controllers').controller('createController',
};
$scope.showAdvChange = function() {
$ionicScrollDelegate.resize();
$timeout(function() {
$ionicScrollDelegate.resize();
}, 10);
};
function updateRCSelect(n) {

View File

@ -14,7 +14,9 @@ angular.module('copayApp.controllers').controller('searchController', function($
window.plugins.toast.hide();
currentTxHistoryPage = 0;
throttleSearch(search);
$ionicScrollDelegate.resize();
$timeout(function() {
$ionicScrollDelegate.resize();
}, 10);
}
var throttleSearch = lodash.throttle(function(search) {

View File

@ -147,7 +147,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
paymentTimeControl(tx.paypro.expires);
$timeout(function() {
$ionicScrollDelegate.resize();
}, 100);
}, 10);
});
}
};

View File

@ -114,9 +114,9 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
}
$scope.addrs = last10;
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
});
$ionicScrollDelegate.resize();
}, 10);
});
});

View File

@ -88,11 +88,10 @@ angular.module('copayApp.controllers').controller('tabHomeController',
if (err) $log.error(err);
$scope.txps = txps;
$scope.txpsN = n;
$ionicScrollDelegate.resize();
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 1);
}, 10);
})
};
@ -128,11 +127,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}
$scope.fetchingNotifications = false;
$scope.notifications = n;
$ionicScrollDelegate.resize();
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 1);
}, 10);
})
};
@ -175,14 +174,18 @@ angular.module('copayApp.controllers').controller('tabHomeController',
lodash.each(['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'], function(service) {
storageService.getNextStep(service, function(err, value) {
$scope.externalServices[service] = value ? true : false;
$ionicScrollDelegate.resize();
$timeout(function() {
$ionicScrollDelegate.resize();
}, 10);
});
});
};
$scope.shouldHideNextSteps = function() {
$scope.hideNextSteps = !$scope.hideNextSteps;
$ionicScrollDelegate.resize();
$timeout(function() {
$ionicScrollDelegate.resize();
}, 10);
};
var listeners = [
@ -207,6 +210,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
configService.whenAvailable(function() {
var config = configService.getSync();
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
$scope.hideNextSteps = false;
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
$scope.amazonEnabled = config.amazon.enabled;