From fb56ad75053dcb7fd8bcd46bb7909b16d32ea5f1 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 13 Jun 2016 14:49:43 -0300 Subject: [PATCH] use scope only - preferences global --- public/views/preferencesGlobal.html | 16 ++++++++-------- src/js/controllers/preferencesGlobal.js | 17 +++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/public/views/preferencesGlobal.html b/public/views/preferencesGlobal.html index 13ccb736e..9bc443cf4 100644 --- a/public/views/preferencesGlobal.html +++ b/public/views/preferencesGlobal.html @@ -3,12 +3,12 @@ ng-init="titleSection='Global preferences'; closeToHome = true; noColor = true"> -
+

  • - {{prefGlobal.currentLanguageName|translate}} + {{currentLanguageName|translate}}
    Language
    @@ -19,7 +19,7 @@
    • - {{prefGlobal.unitName}} + {{unitName}}
      Unit
      @@ -27,7 +27,7 @@
    • - {{prefGlobal.selectedAlternative.name}} + {{selectedAlternative.name}}
      Alternative Currency
      @@ -38,7 +38,7 @@
      • - {{prefGlobal.feeOpts[prefGlobal.currentFeeLevel]|translate}} + {{feeOpts[currentFeeLevel]|translate}}
        Bitcoin Network Fee Policy
        @@ -49,7 +49,7 @@ Use Unconfirmed Funds -
        +

        Enable push notifications @@ -74,9 +74,9 @@
      -
      +
      Push notifications for Copay are currently disabled. Enable them in the Settings app.
      -
        +
        • Open Settings app
      diff --git a/src/js/controllers/preferencesGlobal.js b/src/js/controllers/preferencesGlobal.js index e55dac20e..3891c08b2 100644 --- a/src/js/controllers/preferencesGlobal.js +++ b/src/js/controllers/preferencesGlobal.js @@ -4,17 +4,18 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController', function($scope, $rootScope, $log, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { var isCordova = platformInfo.isCordova; - this.init = function() { + + $scope.init = function() { var config = configService.getSync(); - this.unitName = config.wallet.settings.unitName; - this.currentLanguageName = uxLanguage.getCurrentLanguageName(); - this.selectedAlternative = { + $scope.unitName = config.wallet.settings.unitName; + $scope.currentLanguageName = uxLanguage.getCurrentLanguageName(); + $scope.selectedAlternative = { name: config.wallet.settings.alternativeName, isoCode: config.wallet.settings.alternativeIsoCode }; - this.feeOpts = feeService.feeOpts; - this.currentFeeLevel = feeService.getCurrentFeeLevel(); - this.usePushNotifications = isCordova && !platformInfo.isWP; + $scope.feeOpts = feeService.feeOpts; + $scope.currentFeeLevel = feeService.getCurrentFeeLevel(); + $scope.usePushNotifications = isCordova && !platformInfo.isWP; $scope.PNEnabledByUser = true; $scope.isIOSApp = platformInfo.isIOS && isCordova; if ($scope.isIOSApp) { @@ -28,7 +29,7 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController', $scope.pushNotifications = config.pushNotifications.enabled; }; - this.openSettings = function() { + $scope.openSettings = function() { cordova.plugins.diagnostic.switchToSettings(function() { $log.debug('switched to settings'); }, function(err) {