mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-22 20:40:08 +00:00
allow editing the current SFTP path by double-clicking - #7154, fixed #7291, fixed #7295, fixed #6666, fixed #6646, fixed #6354, fixed #5646
This commit is contained in:
parent
24f8a4bd43
commit
1397d0faed
@ -1,11 +1,22 @@
|
||||
.header
|
||||
.breadcrumb.mr-auto
|
||||
input.form-control.flex-grow-1.w-0(
|
||||
*ngIf='editingPath !== null',
|
||||
type='text',
|
||||
autofocus,
|
||||
(keydown.enter)='confirmPath()',
|
||||
(keydown.esc)='editingPath = null',
|
||||
(blur)='editingPath = null',
|
||||
[(ngModel)]='editingPath'
|
||||
)
|
||||
.breadcrumb(*ngIf='editingPath === null', (dblclick)='editPath()')
|
||||
a.breadcrumb-item((click)='navigate("/")') SFTP
|
||||
a.breadcrumb-item(
|
||||
*ngFor='let segment of pathSegments',
|
||||
(click)='navigate(segment.path)'
|
||||
) {{segment.name}}
|
||||
|
||||
.breadcrumb-spacer.flex-grow-1.h-100((dblclick)='editPath()')
|
||||
|
||||
button.btn.btn-link.btn-sm.d-flex((click)='openCreateDirectoryModal()')
|
||||
i.fas.fa-plus.mr-1
|
||||
div(translate) Create directory
|
||||
|
@ -27,6 +27,7 @@ export class SFTPPanelComponent {
|
||||
@Output() pathChange = new EventEmitter<string>()
|
||||
pathSegments: PathSegment[] = []
|
||||
@Input() cwdDetectionAvailable = false
|
||||
editingPath: string|null = null
|
||||
|
||||
constructor (
|
||||
private ngbModal: NgbModal,
|
||||
@ -182,6 +183,18 @@ export class SFTPPanelComponent {
|
||||
window.localStorage.sshCWDTipDismissed = 'true'
|
||||
}
|
||||
|
||||
editPath (): void {
|
||||
this.editingPath = this.path
|
||||
}
|
||||
|
||||
confirmPath (): void {
|
||||
if (this.editingPath === null) {
|
||||
return
|
||||
}
|
||||
this.navigate(this.editingPath)
|
||||
this.editingPath = null
|
||||
}
|
||||
|
||||
close (): void {
|
||||
this.closed.emit()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user