Return automatically after set unit/lang/alt/color

This commit is contained in:
Gustavo Maximiliano Cortez 2015-11-13 16:00:28 -03:00
commit 370fbd5924
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
9 changed files with 31 additions and 18 deletions

View file

@ -39,7 +39,7 @@
<li>
<a ng-click="$root.go('preferencesGlobal')" class="oh">
<i class="icon-arrow-right3 size-18 right m10t"></i>
<i class="fi-widget size-24 db left m20r m5t"></i>
<i class="fi-widget size-24 icon"></i>
<div class="tu text-bold">
<span class="size-12">Settings</span>
</div>

View file

@ -50,7 +50,7 @@
<li ng-click="$root.go('backup')" ng-hide="index.isPrivKeyExternal">
<div class="right text-gray">
<span class="text-warning" ng-show="index.needsBackup">
<i class="fi-alert"></i><span translate>Still not done</span>
<i class="fi-alert"></i> <span translate>Still not done</span>
</span>
<i class="icon-arrow-right3 size-24 text-gray"></i>
</div>

View file

@ -8,7 +8,7 @@
<div class="content preferences" ng-controller="preferencesGlobalController as prefGlobal" ng-init="prefGlobal.init()">
<ul ng-show="!index.noFocusedWallet" class="no-bullet m0 ">
<ul class="no-bullet m0 ">
<h4></h4>
<li ng-click="$root.go('preferencesLanguage')">
@ -19,7 +19,7 @@
<div translate>Language</div>
</li>
</ul>
<ul ng-show="!index.noFocusedWallet" class="no-bullet m0 ">
<ul class="no-bullet m0 ">
<h4></h4>
<li ng-click="$root.go('preferencesUnit')">
<div class="right text-gray">
@ -36,7 +36,7 @@
<div translate>Alternative Currency</div>
</li>
</ul>
<ul ng-show="!index.noFocusedWallet" class="no-bullet m0 ">
<ul class="no-bullet m0 ">
<h4></h4>
<li ng-click="$root.go('preferencesFee')"
ng-show="(index.network == 'livenet' ? index.feeLevels.livenet : index.feeLevels.testnet)">
@ -51,7 +51,7 @@
<div translate>Use Unconfirmed Funds</div>
</li>
</ul>
<ul ng-show="!index.noFocusedWallet" class="no-bullet m0 ">
<ul class="no-bullet m0 ">
<h4></h4>
<li>
<switch id="glidera-enabled" name="glideraEnabled" ng-model="glideraEnabled" class="green right"></switch>
@ -59,7 +59,7 @@
</li>
<!-- Disabled for testnet
<li ng-show="!index.noFocusedWallet && glideraEnabled">
<li ng-show="glideraEnabled">
<span>Glidera Sandbox</span>
<switch id="glidera-testnet" name="glideraTestnet" ng-model="glideraTestnet" class="green right"></switch>
</li>

View file

@ -868,6 +868,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updateHistory = function() {
var fc = profileService.focusedClient;
if (!fc) return;
var walletId = fc.credentials.walletId;
if (!fc.isComplete() || self.updatingTxHistory[walletId]) return;

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
function($scope, $rootScope, configService, go, rateService, lodash) {
function($scope, $timeout, $log, configService, rateService, lodash, go) {
this.hideAdv = true;
this.hidePriv = true;
this.hideSecret = true;
@ -48,8 +48,12 @@ angular.module('copayApp.controllers').controller('preferencesAltCurrencyControl
};
configService.set(opts, function(err) {
if (err) console.log(err);
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/UnitSettingUpdated');
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesColorController',
function($scope, configService, profileService, go) {
function($scope, $timeout, $log, configService, profileService, go) {
var config = configService.getSync();
this.colorOpts = [
'#DD4B39',
@ -33,12 +33,12 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
opts.colorFor[walletId] = color;
configService.set(opts, function(err) {
if (err) {
$scope.$emit('Local/DeviceError', err);
return;
}
self.color = color;
if (err) $log.warn(err);
go.preferences();
$scope.$emit('Local/ColorUpdated');
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesLanguageController',
function($scope, $log, $timeout, configService, uxLanguage) {
function($scope, $log, $timeout, configService, uxLanguage, go) {
this.availableLanguages = uxLanguage.getLanguages();
@ -17,6 +17,7 @@ angular.module('copayApp.controllers').controller('preferencesLanguageController
configService.set(opts, function(err) {
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/LanguageSettingUpdated');
$timeout(function() {
$scope.$apply();

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesUnitController',
function($rootScope, $scope, $log, configService, go) {
function($scope, $timeout, $log, configService, go) {
var config = configService.getSync();
this.unitName = config.wallet.settings.unitName;
this.unitOpts = [
@ -52,8 +52,11 @@ angular.module('copayApp.controllers').controller('preferencesUnitController',
configService.set(opts, function(err) {
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/UnitSettingUpdated');
go.preferences();
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -79,6 +79,10 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
$state.go('preferences');
};
root.preferencesGlobal = function() {
$state.go('preferencesGlobal');
};
root.reload = function() {
$state.reload();
};