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';
|
'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();
|
controllerUtils.redirIfLogged();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.title = 'Settings';
|
$scope.title = 'Settings';
|
||||||
$scope.defaultLanguage = config.defaultLanguage || 'en';
|
$scope.defaultLanguage = config.defaultLanguage || 'en';
|
||||||
$scope.insightLivenet = config.network.livenet.url;
|
$scope.insightLivenet = config.network.livenet.url;
|
||||||
|
|
@ -102,4 +99,13 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
||||||
var hashIndex = window.location.href.indexOf('#!/');
|
var hashIndex = window.location.href.indexOf('#!/');
|
||||||
window.location = window.location.href.substr(0, hashIndex);
|
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="settings" ng-controller="SettingsController">
|
||||||
<div class="large-4 large-centered medium-6 medium-centered columns">
|
<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">
|
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
|
||||||
<div ng-include="'views/includes/version.html'"></div>
|
<div ng-include="'views/includes/version.html'"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-setup">
|
<div class="box-setup">
|
||||||
<h1>{{title|translate}}</h1>
|
<h1>{{title|translate}}</h1>
|
||||||
<form name="settingsForm">
|
<form name="settingsForm">
|
||||||
|
|
||||||
|
<p class="text-primary size-14"
|
||||||
|
ng-show="message">
|
||||||
|
<i class="fi-check"></i>
|
||||||
|
{{message|translate}}
|
||||||
|
</p>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend translate>Language</legend>
|
<legend translate>Language</legend>
|
||||||
<select class="form-control" ng-model="selectedLanguage" ng-options="o.name for o in availableLanguages" required>
|
<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>
|
<i class="fi-arrow-left"></i>
|
||||||
<span translate>Back</span>
|
<span translate>Back</span>
|
||||||
</a>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue