Files
tabby/terminus-core/src/components/renameTabModal.component.ts
2018-12-18 17:19:41 -08:00

31 lines
709 B
TypeScript

import { Component, Input, ElementRef, ViewChild } from '@angular/core'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
@Component({
selector: 'rename-tab-modal',
template: require('./renameTabModal.component.pug'),
})
export class RenameTabModalComponent {
@Input() value: string
@ViewChild('input') input: ElementRef
constructor (
private modalInstance: NgbActiveModal
) { }
ngOnInit () {
setTimeout(() => {
this.input.nativeElement.focus()
this.input.nativeElement.select()
}, 250)
}
save () {
this.modalInstance.close(this.value)
}
close () {
this.modalInstance.dismiss()
}
}