feat: toggle move to trash to delete permanently on alt key down

This commit is contained in:
Antonella Sgarlatta
2021-07-28 16:18:05 -03:00
parent eb6d8c9cba
commit 44bf907aa4
7 changed files with 74 additions and 43 deletions

View File

@@ -37,6 +37,7 @@
on-dismiss="self.removeChallenge(challenge)"
)
notes-context-menu(
application='self.application'
app-state='self.appState'
)

View File

@@ -49,6 +49,7 @@
) {{self.state.noteStatus.message}}
.desc(ng-show='self.state.noteStatus.desc') {{self.state.noteStatus.desc}}
notes-options-panel(
application='self.application',
app-state='self.appState',
ng-if='self.appState.notes.selectedNotesCount > 0'
)

View File

@@ -64,7 +64,6 @@ type EditorState = {
showOptionsMenu: boolean;
showEditorMenu: boolean;
showHistoryMenu: boolean;
altKeyDown: boolean;
spellcheck: boolean;
/**
* Setting to false then true will allow the current editor component-view to be destroyed
@@ -217,7 +216,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
showOptionsMenu: false,
showEditorMenu: false,
showHistoryMenu: false,
altKeyDown: false,
noteStatus: undefined,
editorUnloading: false,
textareaUnloading: false,
@@ -277,7 +275,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
showOptionsMenu: false,
showEditorMenu: false,
showHistoryMenu: false,
altKeyDown: false,
noteStatus: undefined,
});
this.editorValues.title = note.title;
@@ -843,22 +840,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
}
registerKeyboardShortcuts() {
this.removeAltKeyObserver = this.application
.io
.addKeyObserver({
modifiers: [KeyboardModifier.Alt],
onKeyDown: () => {
this.setState({
altKeyDown: true,
});
},
onKeyUp: () => {
this.setState({
altKeyDown: false,
});
},
});
this.removeTrashKeyObserver = this.application
.io
.addKeyObserver({