color list from config service

This commit is contained in:
Javier 2016-09-22 17:38:33 -03:00
commit 4f2538be32
3 changed files with 69 additions and 20 deletions

View file

@ -1,31 +1,18 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $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"}
];
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $timeout, $log, $stateParams, $ionicHistory, gettextCatalog, configService, profileService) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.wallet = wallet;
var walletId = wallet.credentials.walletId;
var config = configService.getSync();
$scope.colorList = configService.getColorList();
config.colorFor = config.colorFor || {};
$scope.currentColor = config.colorFor[walletId] || '#4A90E2';
$timeout(function() {
$scope.$apply();
});
$scope.save = function(color) {
var opts = {
colorFor: {}