mirror of
https://github.com/eugeny/tabby
synced 2026-07-08 08:01:17 +00:00
fix: Restore hotkey edit and remove actions (#11374)
This commit is contained in:
@@ -298,7 +298,7 @@ jobs:
|
||||
if: matrix.build-arch == 'x64'
|
||||
|
||||
Windows-Build:
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2022
|
||||
needs: Lint
|
||||
strategy:
|
||||
matrix:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.item(*ngFor='let hotkey of hotkeys; let i = index')
|
||||
.body((click)='editItem(i)')
|
||||
.body((mousedown)='editItem(i, $event)')
|
||||
.stroke(*ngFor='let stroke of castAny(hotkey.strokes)')
|
||||
span(*ngIf='!hotkey.isDuplicate') {{stroke}}
|
||||
span.duplicate(*ngIf='hotkey.isDuplicate') {{stroke}}
|
||||
.remove((click)='removeItem(i)') ×
|
||||
.remove((mousedown)='removeItem(i, $event)') ×
|
||||
|
||||
.add((click)='addItem()', translate) Add...
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
.add {
|
||||
flex: auto;
|
||||
opacity: 0;
|
||||
white-space: nowrap;
|
||||
|
||||
&:first-child {
|
||||
opacity: 1;
|
||||
|
||||
@@ -22,7 +22,8 @@ export class MultiHotkeyInputComponent {
|
||||
this.hotkeys = this.hotkeys.map(hotkey => typeof hotkey.strokes === 'string' ? { ...hotkey, strokes: [hotkey.strokes] } : hotkey)
|
||||
}
|
||||
|
||||
editItem (index: number): void {
|
||||
editItem (index: number, event?: MouseEvent): void {
|
||||
if (event && event.button !== 0) { return } // Ignore non-left clicks
|
||||
this.ngbModal.open(HotkeyInputModalComponent).result.then((newStrokes: string[]) => {
|
||||
if (this.hotkeys[index]) {
|
||||
this.hotkeys[index].strokes = newStrokes
|
||||
@@ -38,7 +39,8 @@ export class MultiHotkeyInputComponent {
|
||||
})
|
||||
}
|
||||
|
||||
removeItem (index: number): void {
|
||||
removeItem (index: number, event?: MouseEvent): void {
|
||||
if (event && event.button !== 0) { return } // Ignore non-left clicks
|
||||
this.hotkeys = this.hotkeys.filter((_, i) => i !== index)
|
||||
this.storeUpdatedHotkeys()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user