forked from lthn/blockchain
* test details & close btn * compiled * confirm modal * delete "cancel" btn from aliases * fix copy btn * text alias fix * confirm pop up * lock & unlock transaction * confirm pop up comment fix * compiled * rebuild html * contact service * rebuild html * fix add contact + rebuild html * allow symbols at name field diffrent from latin * fix export import * alias fix * fix master pass (immigration 41 > 43) * rebuild html * commit * fix * rebuild
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
|
|
import { Location } from '@angular/common';
|
|
import { VariablesService } from '../_helpers/services/variables.service';
|
|
import { BackendService } from '../_helpers/services/backend.service';
|
|
|
|
@Component({
|
|
selector: 'app-contacts',
|
|
templateUrl: './contacts.component.html',
|
|
styleUrls: ['./contacts.component.scss']
|
|
})
|
|
export class ContactsComponent implements OnInit {
|
|
calculatedWidth = [];
|
|
@ViewChild('head') head: ElementRef;
|
|
|
|
constructor(
|
|
private location: Location,
|
|
private variablesService: VariablesService,
|
|
private backend: BackendService
|
|
) {}
|
|
|
|
ngOnInit() {
|
|
this.backend.getContactAlias();
|
|
}
|
|
|
|
delete(index: number) {
|
|
if (this.variablesService.appPass) {
|
|
this.variablesService.contacts.splice(index, 1);
|
|
this.backend.storeSecureAppData();
|
|
}
|
|
}
|
|
|
|
calculateWidth() {
|
|
this.calculatedWidth = [];
|
|
this.calculatedWidth.push(
|
|
this.head.nativeElement.childNodes[0].clientWidth
|
|
);
|
|
this.calculatedWidth.push(
|
|
this.head.nativeElement.childNodes[1].clientWidth +
|
|
this.head.nativeElement.childNodes[2].clientWidth
|
|
);
|
|
this.calculatedWidth.push(
|
|
this.head.nativeElement.childNodes[3].clientWidth
|
|
);
|
|
this.calculatedWidth.push(
|
|
this.head.nativeElement.childNodes[4].clientWidth
|
|
);
|
|
}
|
|
|
|
// openInBrowser(alias: string) {
|
|
// if (alias !== null) {
|
|
// this.backend.openUrlInBrowser(
|
|
// `explorer.zano.org/aliases/${alias.slice(1)}#modalOpen`
|
|
// );
|
|
// }
|
|
// }
|
|
|
|
back() {
|
|
this.location.back();
|
|
}
|
|
}
|