mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #4339 from JDonadio/bug/select-color
Fix color selection - IOs
This commit is contained in:
commit
ec33c32733
|
@ -1,18 +1,11 @@
|
|||
<div
|
||||
class="topbar-container"
|
||||
ng-include="'views/includes/topbar.html'"
|
||||
<div class="topbar-container" ng-include="'views/includes/topbar.html'"
|
||||
ng-init="titleSection='Color'; goBackToState = 'preferences'">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="content preferences" ng-controller="preferencesColorController as p">
|
||||
<div class="content preferences" ng-controller="preferencesColorController">
|
||||
<h4></h4>
|
||||
<ul class="no-bullet m0">
|
||||
<li ng-repeat="c in p.colorOpts" ng-click="p.save(c)">
|
||||
|
||||
<ion-radio class="size-12" ng-repeat="c in colorList" ng-value="c" ng-model="currentColor" ng-click="save(c)">
|
||||
<span ng-style="{'color': c}">█</span>
|
||||
<i class="fi-check size-16 right" ng-show="p.color == c"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</ion-radio>
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
|
|
|
@ -1,47 +1,41 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesColorController',
|
||||
function($scope, $timeout, $log, configService, profileService, go) {
|
||||
var config = configService.getSync();
|
||||
this.colorOpts = [
|
||||
'#DD4B39',
|
||||
'#F38F12',
|
||||
'#FAA77F',
|
||||
'#D0B136',
|
||||
'#9EDD72',
|
||||
'#29BB9C',
|
||||
'#019477',
|
||||
'#77DADA',
|
||||
'#4A90E2',
|
||||
'#484ED3',
|
||||
'#9B59B6',
|
||||
'#E856EF',
|
||||
'#FF599E',
|
||||
'#7A8C9E',
|
||||
];
|
||||
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $log, configService, profileService, go) {
|
||||
|
||||
var fc = profileService.focusedClient;
|
||||
var walletId = fc.credentials.walletId;
|
||||
$scope.colorList = [
|
||||
'#DD4B39',
|
||||
'#F38F12',
|
||||
'#FAA77F',
|
||||
'#D0B136',
|
||||
'#9EDD72',
|
||||
'#29BB9C',
|
||||
'#019477',
|
||||
'#77DADA',
|
||||
'#4A90E2',
|
||||
'#484ED3',
|
||||
'#9B59B6',
|
||||
'#E856EF',
|
||||
'#FF599E',
|
||||
'#7A8C9E',
|
||||
];
|
||||
|
||||
var config = configService.getSync();
|
||||
config.colorFor = config.colorFor || {};
|
||||
this.color = config.colorFor[walletId] || '#4A90E2';
|
||||
var fc = profileService.focusedClient;
|
||||
var walletId = fc.credentials.walletId;
|
||||
var config = configService.getSync();
|
||||
config.colorFor = config.colorFor || {};
|
||||
|
||||
this.save = function(color) {
|
||||
var self = this;
|
||||
var opts = {
|
||||
colorFor: {}
|
||||
};
|
||||
opts.colorFor[walletId] = color;
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
go.preferences();
|
||||
$scope.$emit('Local/ColorUpdated');
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 100);
|
||||
});
|
||||
$scope.currentColor = config.colorFor[walletId] || '#4A90E2';
|
||||
|
||||
$scope.save = function(color) {
|
||||
var opts = {
|
||||
colorFor: {}
|
||||
};
|
||||
});
|
||||
opts.colorFor[walletId] = color;
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
go.preferences();
|
||||
if (err) $log.warn(err);
|
||||
$scope.$emit('Local/ColorUpdated');
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue