add restore default buttons
This commit is contained in:
parent
4726570b7a
commit
5113e8b292
2 changed files with 25 additions and 5 deletions
|
|
@ -1,13 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('SettingsController', function($scope, $rootScope, $window, $location, controllerUtils, notification) {
|
||||
angular.module('copayApp.controllers').controller('SettingsController', function($scope, $rootScope, $window, $route, $location, $anchorScroll, controllerUtils, notification) {
|
||||
|
||||
|
||||
controllerUtils.redirIfLogged();
|
||||
|
||||
|
||||
|
||||
|
||||
$scope.title = 'Settings';
|
||||
$scope.defaultLanguage = config.defaultLanguage || 'en';
|
||||
$scope.insightLivenet = config.network.livenet.url;
|
||||
|
|
@ -102,4 +99,13 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
|||
var hashIndex = window.location.href.indexOf('#!/');
|
||||
window.location = window.location.href.substr(0, hashIndex);
|
||||
};
|
||||
|
||||
|
||||
$scope.reset = function() {
|
||||
localStorage.removeItem('config');
|
||||
$location.hash('top');
|
||||
$anchorScroll();
|
||||
$scope.message= 'Settings were reset to defaults';
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,19 @@
|
|||
<div class="settings" ng-controller="SettingsController">
|
||||
<div class="large-4 large-centered medium-6 medium-centered columns">
|
||||
<div class="logo-setup">
|
||||
<div class="logo-setup" id="top">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
</div>
|
||||
<div class="box-setup">
|
||||
<h1>{{title|translate}}</h1>
|
||||
<form name="settingsForm">
|
||||
|
||||
<p class="text-primary size-14"
|
||||
ng-show="message">
|
||||
<i class="fi-check"></i>
|
||||
{{message|translate}}
|
||||
</p>
|
||||
|
||||
<fieldset>
|
||||
<legend translate>Language</legend>
|
||||
<select class="form-control" ng-model="selectedLanguage" ng-options="o.name for o in availableLanguages" required>
|
||||
|
|
@ -52,6 +59,13 @@
|
|||
<i class="fi-arrow-left"></i>
|
||||
<span translate>Back</span>
|
||||
</a>
|
||||
<div class="right m10r">
|
||||
<a class="button-setup text-gray" href="" ng-click="reset()">
|
||||
<i class="fi-page-delete"></i>
|
||||
<span translate>Reset settings</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue