mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-29 12:55:21 +01:00
psss doc to copy function
This commit is contained in:
parent
97fe01e131
commit
23917010a7
@ -14,7 +14,7 @@ export class PasswordGeneratorHistoryComponent implements OnInit {
|
||||
|
||||
constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,
|
||||
protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,
|
||||
protected toasterService: ToasterService) { }
|
||||
protected toasterService: ToasterService, private win: Window) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.history = await this.passwordGenerationService.getHistory();
|
||||
@ -27,7 +27,8 @@ export class PasswordGeneratorHistoryComponent implements OnInit {
|
||||
|
||||
copy(password: string) {
|
||||
this.analytics.eventTrack.next({ action: 'Copied Historical Password' });
|
||||
this.platformUtilsService.copyToClipboard(password);
|
||||
const copyOptions = this.win != null ? { doc: this.win.document } : null;
|
||||
this.platformUtilsService.copyToClipboard(password, copyOptions);
|
||||
this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ export class PasswordGeneratorComponent implements OnInit {
|
||||
|
||||
constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,
|
||||
protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,
|
||||
protected toasterService: ToasterService) { }
|
||||
protected toasterService: ToasterService, private win: Window) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.options = await this.passwordGenerationService.getOptions();
|
||||
@ -61,7 +61,8 @@ export class PasswordGeneratorComponent implements OnInit {
|
||||
|
||||
copy() {
|
||||
this.analytics.eventTrack.next({ action: 'Copied Generated Password' });
|
||||
this.platformUtilsService.copyToClipboard(this.password);
|
||||
const copyOptions = this.win != null ? { doc: this.win.document } : null;
|
||||
this.platformUtilsService.copyToClipboard(this.password, copyOptions);
|
||||
this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,8 @@ export class ViewComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
this.analytics.eventTrack.next({ action: 'Copied ' + aType });
|
||||
this.platformUtilsService.copyToClipboard(value);
|
||||
const copyOptions = this.win != null ? { doc: this.win.document } : null;
|
||||
this.platformUtilsService.copyToClipboard(value, copyOptions);
|
||||
this.toasterService.popAsync('info', null,
|
||||
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user