Merge pull request #212 from gabrielbazan7/fix/scrollResize

add timeout to resize and fix advanced settings
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-28 15:50:54 -03:00 committed by GitHub
commit e93da3f391
8 changed files with 26 additions and 18 deletions

View File

@ -33,7 +33,7 @@
</a> </a>
</div> </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"> <a class="item item-icon-right item-heading" ui-sref="tabs.activity">
<span translate>Recent Transactions</span> <span translate>Recent Transactions</span>
<i class="icon nav-item-arrow-right"></i> <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-down" ng-if="!hideNextSteps"></i>
<i class="icon nav-item-arrow-up" ng-if="hideNextSteps"></i> <i class="icon nav-item-arrow-up" ng-if="hideNextSteps"></i>
</div> </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"> <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"> <i class="icon big-icon-svg">
<div class="bg icon-create-wallet"></div> <div class="bg icon-create-wallet"></div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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