|
16 | 16 | <script src="../../js/ui-bootstrap.min.js"></script> |
17 | 17 | <script src="../../js/angular-color-picker.js"></script> |
18 | 18 | <script src="../../js/shared.js"></script> |
19 | | - |
| 19 | + <script type="text/javascript" src="/app/scripts/framework/pluginAPI/datastoreAPI.js"></script> |
20 | 20 | </head> |
21 | 21 | <body ng-controller="folderPluginCtrl" ng-cloak ng-show="datastoreInitialized"> |
22 | 22 | <div ng-form="frmMain"> |
|
117 | 117 | </div> |
118 | 118 | <div class="main col-md-9 pull-right"> |
119 | 119 | <div class="radio radio-primary radio-inline"> |
120 | | - <input id="appearance" type="radio" name="colorType" ng-checked="colorType=='A'" ng-click="setColorType('A')"/> |
| 120 | + <input id="appearance" type="radio" name="colorType" ng-checked="data.design.colorType=='A'" ng-click="setColorType('A')"/> |
121 | 121 | <label for="appearance">Inherit Appearance Theme</label> |
122 | 122 | </div> |
123 | 123 | <div class="radio radio-primary radio-inline"> |
124 | | - <input id="customColor" type="radio" name="colorType" ng-checked="colorType=='C'" ng-click="setColorType('C')"/> |
| 124 | + <input id="customColor" type="radio" name="colorType" ng-checked="data.design.colorType=='C'" ng-click="setColorType('C')"/> |
125 | 125 | <label for="customColor">Custom Theme</label> |
126 | 126 | </div> |
127 | 127 | </div> |
128 | 128 | </div> |
129 | 129 | <hr class="none"> |
130 | | - <div class="item clearfix row margin-bottom-twenty" ng-if="colorType=='C'"> |
| 130 | + <div class="item clearfix row margin-bottom-twenty" ng-if="data.design.colorType=='C'"> |
131 | 131 | <div class="main col-md-9 pull-right"> |
132 | 132 | <div class="colorgrid pull-left"> |
133 | 133 | <div class="colorgrid pull-left row"> |
|
151 | 151 |
|
152 | 152 | folderPluginApp.controller('folderPluginCtrl', ['$scope', '$window', function ($scope, $window) { |
153 | 153 | $scope.defaultColors = { |
154 | | - "backgroundColor": "", |
155 | | - "bodyText": "", |
156 | | - "icons": "" |
| 154 | + "backgroundColor": "#FFFFFF", |
| 155 | + "bodyText": "#32373a", |
| 156 | + "icons": "#09a3ee" |
157 | 157 | }; |
158 | 158 |
|
159 | 159 | $scope.availableLayouts = folderPluginShared.getLayouts(); |
|
191 | 191 | backgroundImage: {}, |
192 | 192 | selectedLayout: 1, |
193 | 193 | backgroundblur: 0, |
194 | | - colors: {} |
| 194 | + colorType: 'A' |
195 | 195 | }; |
196 | 196 | } |
197 | 197 | else { |
|
204 | 204 | } |
205 | 205 |
|
206 | 206 | $scope.data.design = $scope.data.design || {}; |
207 | | - $scope.data.design.colors = $scope.data.design.colors || {}; |
208 | | - |
209 | | - $scope.colorType = angular.equals({}, $scope.data.design.colors) ? "A" : "C"; |
| 207 | + if (!$scope.data.design.colorType) { |
| 208 | + $scope.data.design.colorType = "A"; |
| 209 | + } |
210 | 210 |
|
211 | 211 | /* |
212 | 212 | * watch for changes in data and trigger the saveData function on change |
|
317 | 317 | }; |
318 | 318 |
|
319 | 319 | $scope.setColorType = function (colorType) { |
320 | | - if ($scope.colorType === colorType) return; |
321 | | - $scope.colorType = colorType; |
322 | | - $scope.data.design.colors = {}; |
| 320 | + if ($scope.data.design.colorType === colorType) return; |
| 321 | + $scope.data.design.colorType = colorType; |
| 322 | + if ($scope.data.design.colorType === "C" && !$scope.data.design.colors) { |
| 323 | + $scope.data.design.colors = $scope.defaultColors; |
| 324 | + } |
323 | 325 | }; |
324 | 326 |
|
325 | 327 | angular.element($window).bind('mousedown', function () { |
|
0 commit comments