diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-04-03 12:56:33 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-04-03 12:56:33 -0400 |
| commit | 5026318b0a88f9201708db371cbd27e768997963 (patch) | |
| tree | 0b7bbe87562d9c0461c768fb1892a34ea6154c21 /www/js/MontageCtrl.js | |
| parent | ab51909e327dfdd0449479ea4e830bebf257487b (diff) | |
montage profile save - show existing list too
Diffstat (limited to 'www/js/MontageCtrl.js')
| -rw-r--r-- | www/js/MontageCtrl.js | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index e97dfe9f..027cd052 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1366,13 +1366,51 @@ angular.module('zmApp.controllers') // save current configuration into a profile $scope.saveMontageProfile = function() { + + var posArray; + + try + { + posArray = NVRDataModel.getLogin().packeryPositionsArray; + //console.log ("PA="+JSON.stringify(posArray)); + + } + catch (e) + { + NVRDataModel.debug("error parsing packery array positions"); + posArray = {}; + } $scope.data = { montageName: "" }; + + $scope.listdata = []; + for (var key in posArray) + { + if (posArray.hasOwnProperty(key)) + { + $scope.listdata.push(key); + } + } + if ($scope.listdata.indexOf($translate.instant('kMontageDefaultProfile')) == -1) + $scope.listdata.push($translate.instant('kMontageDefaultProfile')); + + + var templ = "<input autocapitalize='none' autocomplete='off' autocorrect='off' type='text' ng-model='data.montageName'>"; + + if ($scope.listdata.length) + templ += '<br/><div class="item item-divider">'+$translate.instant('kMontageSavedProfiles')+'</div>'+ + '<ion-list> ' + + ' <ion-radio-fix ng-repeat="item in listdata" ng-value="item" ng-model="data.montageName"> ' + + ' {{item}} ' + + ' </ion-item> ' + + '</ion-list> '; + + $rootScope.zmPopup = SecuredPopups.show('confirm', { title: $translate.instant('kMontageSave'), - template: "<input autocapitalize='none' autocomplete='off' autocorrect='off' type='text' ng-model='data.montageName'>", + template: templ, subTitle: $translate.instant('kMontageSaveSubtitle'), scope: $scope, okText: $translate.instant('kButtonOk'), |
