diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-05-25 21:04:25 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-05-25 21:04:25 -0400 |
| commit | 92c3f2f7d30741ac708dd18deddfaecd9e0e34d5 (patch) | |
| tree | 31a47b5c9825836c64b3879d38c7f87dec53b597 /www/js/FirstUseCtrl.js | |
| parent | f4586bd7cb9b5a477f2e11a2006d569f139f092c (diff) | |
#261 - option to switch languages
Former-commit-id: 3d0903622ca447f8c58b7bcc409df57e7b07d4a2
Diffstat (limited to 'www/js/FirstUseCtrl.js')
| -rw-r--r-- | www/js/FirstUseCtrl.js | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/www/js/FirstUseCtrl.js b/www/js/FirstUseCtrl.js index 2e0d5c85..b9031309 100644 --- a/www/js/FirstUseCtrl.js +++ b/www/js/FirstUseCtrl.js @@ -2,7 +2,7 @@ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console */ -angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory','$state', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $ionicHistory, $state) { +angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory','$state', 'ZMDataModel', '$rootScope', '$ionicPopup', '$translate', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $ionicHistory, $state, ZMDataModel, $rootScope, $ionicPopup, $translate) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -19,6 +19,43 @@ $scope.openMenu = function () { }); + $scope.switchLang = function() + { + $scope.lang = ZMDataModel.getLanguages(); + $scope.myopt = {lang:""}; + + $rootScope.zmPopup = $ionicPopup.show({ + scope: $scope, + template: '<ion-radio-fix ng-repeat="item in lang" ng-value="item.value" ng-model="myopt.lang"> {{item.text}} </ion-radio-fix>', + + + title: $translate.instant('kSelectLanguage'), + + buttons: [ + { + text: $translate.instant('kButtonCancel'), + onTap: function (e) { + //return "CANCEL"; + } + + }, + { + text: $translate.instant('kButtonOk'), + onTap: function (e) { + ZMDataModel.zmLog("Language selected:"+$scope.myopt.lang); + ZMDataModel.setDefaultLanguage($scope.myopt.lang, true); + + + //return "OK"; + + } + } + ] + }); + + + }; + $scope.goToLogin = function() { $ionicHistory.nextViewOptions({ |
