1
0
Fork 0
forked from lthn/blockchain

Close button (#151)

* close btn

* rebuild html
This commit is contained in:
zetov 2019-12-27 19:34:10 +02:00 committed by cryptozoidberg
parent 2a141a2b59
commit b6b98a9379
12 changed files with 406 additions and 228 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -649,7 +649,7 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
/*! no static exports found */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.10' };
var core = module.exports = { version: '2.6.11' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,7 @@
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.25);
z-index: 5;
}
.modal {
position: relative;

View file

@ -7,6 +7,9 @@
<div class="sidebar-account-row account-title-balance">
<span class="title" tooltip="{{ wallet.name }}" placement="top-left" tooltipClass="table-tooltip account-tooltip" [delay]="500" [showWhenNoOverflow]="false">{{wallet.name}}</span>
<span class="balance">{{wallet.balance | intToMoney : '3' }} {{variablesService.defaultCurrency}}</span>
<button type="button" (click)="showDialog(wallet.wallet_id)" tooltip="{{ 'WALLET.TOOLTIPS.CLOSE' | translate }}" placement="top-left" tooltipClass="table-tooltip account-tooltip" [delay]="500" [timeDelay]="500">
<i class="icon close-wallet"></i>
</button>
</div>
<div class="sidebar-account-row account-alias">
<div class="name">
@ -155,3 +158,4 @@
</div>
</div>
<app-confirm-modal *ngIf="isModalDialogVisible" [title]=" 'WALLET.CONFIRM.TITLE' | translate " [message]=" 'WALLET.CONFIRM.MESSAGE' | translate " (confirmed)="confirmed($event)"></app-confirm-modal>

View file

@ -179,6 +179,31 @@
}
}
}
button {
display: flex;
align-items: center;
background: transparent;
border: none;
cursor: pointer;
font-weight: 400;
outline: none;
padding: 0;
padding-bottom: 5rem;
position: absolute;
left: 105%;
.icon {
margin-right: 1.2rem;
width: 1.3rem;
height: 1.3rem;
&.close-wallet {
mask: url(../../assets/icons/close-wallet.svg) no-repeat center;
margin-right: 0;
}
}
}
}
&:focus {

View file

@ -20,6 +20,9 @@ export class SidebarComponent implements OnInit, OnDestroy {
settings = icons.settings;
exit = icons.exit;
isModalDialogVisible = false;
closeWalletId: number;
constructor(
private route: ActivatedRoute,
private router: Router,
@ -68,6 +71,39 @@ export class SidebarComponent implements OnInit, OnDestroy {
}
}
showDialog(wallet_id) {
this.isModalDialogVisible = true;
this.closeWalletId = wallet_id;
}
confirmed(confirmed: boolean) {
if (confirmed) {
this.closeWallet(this.closeWalletId);
}
this.isModalDialogVisible = false;
}
closeWallet(wallet_id) {
this.backend.closeWallet(wallet_id, () => {
for (let i = this.variablesService.wallets.length - 1; i >= 0; i--) {
if (this.variablesService.wallets[i].wallet_id === this.variablesService.currentWallet.wallet_id) {
this.variablesService.wallets.splice(i, 1);
}
}
this.ngZone.run(() => {
if (this.variablesService.wallets.length) {
this.variablesService.currentWallet = this.variablesService.wallets[0];
this.router.navigate(['/wallet/' + this.variablesService.currentWallet.wallet_id]);
} else {
this.router.navigate(['/']);
}
});
if (this.variablesService.appPass) {
this.backend.storeSecureAppData();
}
});
}
getUpdate() {
this.backend.openUrlInBrowser('zano.org/downloads.html');
}

View file

@ -17,9 +17,6 @@
<button [routerLink]="['/details']" routerLinkActive="active" tooltip="{{ 'WALLET.TOOLTIPS.SETTINGS' | translate }}" placement="left" tooltipClass="table-tooltip account-tooltip" [delay]="500" [timeDelay]="500">
<i class="icon details"></i>
</button>
<button type="button" (click)="showDialog()" tooltip="{{ 'WALLET.TOOLTIPS.CLOSE' | translate }}" placement="bottom-right" tooltipClass="table-tooltip account-tooltip" [delay]="500" [timeDelay]="500">
<i class="icon close-wallet"></i>
</button>
</div>
</div>
<div class="address">
@ -57,5 +54,3 @@
</div>
</div>
</div>
<app-confirm-modal *ngIf="isModalDialogVisible" [title]=" 'WALLET.CONFIRM.TITLE' | translate " [message]=" 'WALLET.CONFIRM.MESSAGE' | translate " (confirmed)="confirmed($event)"></app-confirm-modal>

View file

@ -22,7 +22,6 @@ export class WalletComponent implements OnInit, OnDestroy {
copyAnimation = false;
copyAnimationTimeout;
balanceTooltip;
isModalDialogVisible = false;
activeTab = 'history';
public currentPage = 1;
@ -189,38 +188,6 @@ export class WalletComponent implements OnInit, OnDestroy {
this.backend.openUrlInBrowser(link);
}
showDialog() {
this.isModalDialogVisible = true;
}
confirmed(confirmed: boolean) {
if (confirmed) {
this.closeWallet();
}
this.isModalDialogVisible = false;
}
closeWallet() {
this.backend.closeWallet(this.variablesService.currentWallet.wallet_id, () => {
for (let i = this.variablesService.wallets.length - 1; i >= 0; i--) {
if (this.variablesService.wallets[i].wallet_id === this.variablesService.currentWallet.wallet_id) {
this.variablesService.wallets.splice(i, 1);
}
}
this.ngZone.run(() => {
if (this.variablesService.wallets.length) {
this.variablesService.currentWallet = this.variablesService.wallets[0];
this.router.navigate(['/wallet/' + this.variablesService.currentWallet.wallet_id]);
} else {
this.router.navigate(['/']);
}
});
if (this.variablesService.appPass) {
this.backend.storeSecureAppData();
}
});
}
public setPage(pageNumber: number) {
if (pageNumber === this.variablesService.currentWallet.currentPage) {
return;