mirror of https://github.com/BTCPrivate/copay.git
refactory of the confirmation popup
This commit is contained in:
parent
024a80d725
commit
99de32fc5d
|
@ -256,23 +256,6 @@ angular.module('copayApp.directives')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
// From https://gist.github.com/asafge/7430497
|
|
||||||
.directive('ngReallyClick', [
|
|
||||||
|
|
||||||
function() {
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
link: function(scope, element, attrs) {
|
|
||||||
element.bind('click', function() {
|
|
||||||
var message = attrs.ngReallyMessage;
|
|
||||||
if (message && confirm(message)) {
|
|
||||||
scope.$apply(attrs.ngReallyClick);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
|
||||||
.directive('showFocus', function($timeout) {
|
.directive('showFocus', function($timeout) {
|
||||||
return function(scope, element, attrs) {
|
return function(scope, element, attrs) {
|
||||||
scope.$watch(attrs.showFocus,
|
scope.$watch(attrs.showFocus,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<div class="text-center" ng-init="isComplete = item.isComplete(); networkName = item.getNetworkName()">
|
<div class="text-center" ng-init="isComplete = item.isComplete(); networkName = item.getNetworkName()">
|
||||||
|
<div ng-show="!confirmDelete">
|
||||||
<h1>{{item.name || item.id }}</h1>
|
<h1>{{item.name || item.id }}</h1>
|
||||||
<h3>
|
<h3>
|
||||||
{{item.requiredCopayers}} of {{item.totalCopayers}} - {{networkName}}
|
{{item.requiredCopayers}} of {{item.totalCopayers}} - {{networkName}}
|
||||||
|
@ -29,15 +30,8 @@
|
||||||
ng-show="isSafari || isCordova"><i class="fi-eye"></i> View Backup</button>
|
ng-show="isSafari || isCordova"><i class="fi-eye"></i> View Backup</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-6 medium-6 small-12 columns">
|
<div class="large-6 medium-6 small-12 columns">
|
||||||
<button class="warning expand" ng-disabled="loading"
|
<button class="warning expand" ng-click="confirmDelete=!confirmDelete">
|
||||||
ng-really-message="{{'Are you sure you want to delete the wallet'}} {{(item.name || item.id)}}"
|
|
||||||
ng-really-click="deleteWallet()">
|
|
||||||
<span ng-show="!loading">
|
|
||||||
<i class="fi-trash"></i> Delete
|
<i class="fi-trash"></i> Delete
|
||||||
</span>
|
|
||||||
<span ng-show="loading">
|
|
||||||
<i class="fi-bitcoin-circle icon-rotate spinner"></i> Deleting...
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,3 +49,23 @@
|
||||||
</div>
|
</div>
|
||||||
<a class="close-reveal-modal" ng-click="close()"><i class="fi-x size-18"></i></a>
|
<a class="close-reveal-modal" ng-click="close()"><i class="fi-x size-18"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row" ng-show="confirmDelete">
|
||||||
|
<h1>Are you sure you want to delete the wallet
|
||||||
|
<strong>{{(item.name || item.id)}}</strong>
|
||||||
|
</h1>
|
||||||
|
<div class="large-6 medium-6 small-6 columns">
|
||||||
|
<button class="default" ng-disabled="loading"
|
||||||
|
ng-click="confirmDelete=!confirmDelete">Cancel</button>
|
||||||
|
</div>
|
||||||
|
<div class="large-6 medium-6 small-6 columns">
|
||||||
|
<button class="warning" ng-disabled="loading" ng-click="deleteWallet()">
|
||||||
|
<span ng-show="!loading">
|
||||||
|
<i class="fi-trash"></i> Delete
|
||||||
|
</span>
|
||||||
|
<span ng-show="loading">
|
||||||
|
<i class="fi-bitcoin-circle icon-rotate spinner"></i> Deleting...
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -128,10 +128,22 @@
|
||||||
<span translate>Delete Profile</span>
|
<span translate>Delete Profile</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p translate class="text-gray">Permanently delete this profile and all its wallets. WARNING: this action cannot be reversed.</p>
|
<p translate class="text-gray">Permanently delete this profile and all its wallets. WARNING: this action cannot be reversed.</p>
|
||||||
<a translate class="button warning m0" ng-really-message="{{'Are you sure you want to delete this profile?' | translate}}"
|
<div ng-show="!confirmDelete">
|
||||||
ng-really-click="deleteProfile()">Delete Profile
|
<a translate class="button warning m0" ng-click="confirmDelete=!confirmDelete">Delete Profile
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-center" ng-show="confirmDelete">
|
||||||
|
<h2>Are you sure you want to delete this profile?</h2>
|
||||||
|
<div class="row">
|
||||||
|
<div class="large-6 medium-6 small-6 columns">
|
||||||
|
<a translate class="button default m0" ng-click="confirmDelete=!confirmDelete">Cancel</a>
|
||||||
|
</div>
|
||||||
|
<div class="large-6 medium-6 small-6 columns">
|
||||||
|
<a translate class="button warning m0" ng-click="deleteProfile()">Delete</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue