mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #166 from JDonadio/ref/color-list
Color list from config service
This commit is contained in:
commit
05059638f7
|
@ -7,7 +7,7 @@
|
||||||
</ion-nav-back-button>
|
</ion-nav-back-button>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-radio ng-repeat="c in colorList" ng-value="c.color" ng-model="currentColor" ng-click="save(c.color)">
|
<ion-radio ng-repeat="c in colorList" ng-value="c" ng-model="currentColor" ng-click="save(c.color)">
|
||||||
<span ng-style="{'color': c.color}">█</span>
|
<span ng-style="{'color': c.color}">█</span>
|
||||||
<span> {{c.name}}</span>
|
<span> {{c.name}}</span>
|
||||||
</ion-radio>
|
</ion-radio>
|
||||||
|
|
|
@ -1,31 +1,18 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $log, $stateParams, $ionicHistory, gettextCatalog, configService, profileService) {
|
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $timeout, $log, $stateParams, $ionicHistory, gettextCatalog, configService, profileService) {
|
||||||
$scope.colorList = [
|
|
||||||
{color: "#DD4B39", name: "Cinnabar"},
|
|
||||||
{color: "#F38F12", name: "Carrot Orange"},
|
|
||||||
{color: "#FAA77F", name: "Light Salmon"},
|
|
||||||
{color: "#D0B136", name: "Metallic Gold"},
|
|
||||||
{color: "#9EDD72", name: "Feijoa"},
|
|
||||||
{color: "#29BB9C", name: "Shamrock"},
|
|
||||||
{color: "#019477", name: "Observatory"},
|
|
||||||
{color: "#77DADA", name: "Turquoise Blue"},
|
|
||||||
{color: "#4A90E2", name: "Cornflower Blue"},
|
|
||||||
{color: "#484ED3", name: "Free Speech Blue"},
|
|
||||||
{color: "#9B59B6", name: "Deep Lilac"},
|
|
||||||
{color: "#E856EF", name: "Free Speech Magenta"},
|
|
||||||
{color: "#FF599E", name: "Brilliant Rose"},
|
|
||||||
{color: "#7A8C9E", name: "Light Slate Grey"}
|
|
||||||
];
|
|
||||||
|
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
$scope.wallet = wallet;
|
$scope.wallet = wallet;
|
||||||
var walletId = wallet.credentials.walletId;
|
var walletId = wallet.credentials.walletId;
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
|
$scope.colorList = configService.getColorList();
|
||||||
config.colorFor = config.colorFor || {};
|
config.colorFor = config.colorFor || {};
|
||||||
|
|
||||||
$scope.currentColor = config.colorFor[walletId] || '#4A90E2';
|
$scope.currentColor = config.colorFor[walletId] || '#4A90E2';
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$apply();
|
||||||
|
});
|
||||||
|
|
||||||
$scope.save = function(color) {
|
$scope.save = function(color) {
|
||||||
var opts = {
|
var opts = {
|
||||||
colorFor: {}
|
colorFor: {}
|
||||||
|
|
|
@ -89,6 +89,68 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
||||||
|
|
||||||
var configCache = null;
|
var configCache = null;
|
||||||
|
|
||||||
|
var colorList = [
|
||||||
|
{
|
||||||
|
color: "#DD4B39",
|
||||||
|
name: "Cinnabar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#F38F12",
|
||||||
|
name: "Carrot Orange"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#FAA77F",
|
||||||
|
name: "Light Salmon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#D0B136",
|
||||||
|
name: "Metallic Gold"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#9EDD72",
|
||||||
|
name: "Feijoa"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#29BB9C",
|
||||||
|
name: "Shamrock"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#019477",
|
||||||
|
name: "Observatory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#77DADA",
|
||||||
|
name: "Turquoise Blue"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#4A90E2",
|
||||||
|
name: "Cornflower Blue"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#484ED3",
|
||||||
|
name: "Free Speech Blue"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#9B59B6",
|
||||||
|
name: "Deep Lilac"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#E856EF",
|
||||||
|
name: "Free Speech Magenta"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#FF599E",
|
||||||
|
name: "Brilliant Rose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: "#7A8C9E",
|
||||||
|
name: "Light Slate Grey"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
root.getColorList = function() {
|
||||||
|
return colorList;
|
||||||
|
};
|
||||||
|
|
||||||
root.getSync = function() {
|
root.getSync = function() {
|
||||||
if (!configCache)
|
if (!configCache)
|
||||||
|
|
Loading…
Reference in New Issue