From db97d6d4b602f37c69657419d3dd907b2dabf628 Mon Sep 17 00:00:00 2001 From: Anton Emelyanov Date: Tue, 1 Jun 2021 17:52:30 +0300 Subject: [PATCH 1/2] fix missing whitespace in permissions-modal (#568) --- app/assets/templates/directives/permissions-modal.pug | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/templates/directives/permissions-modal.pug b/app/assets/templates/directives/permissions-modal.pug index 52f452083..0ae709c0e 100644 --- a/app/assets/templates/directives/permissions-modal.pug +++ b/app/assets/templates/directives/permissions-modal.pug @@ -15,6 +15,7 @@ .sk-panel-row p.sk-p | Extensions use an offline messaging system to communicate. Learn more at + | a.sk-a.info( href='https://standardnotes.org/permissions', rel='noopener', From 3823836863781f930fce29d67059fb23242a85fa Mon Sep 17 00:00:00 2001 From: Antonella Sgarlatta Date: Wed, 2 Jun 2021 11:20:24 -0300 Subject: [PATCH 2/2] fix: disregard modifiers for note selection if user hasn't triggered the action --- .../javascripts/ui_models/app_state/notes_state.ts | 12 ++++++++---- app/assets/javascripts/views/notes/notes-view.pug | 2 +- app/assets/javascripts/views/notes/notes_view.ts | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/ui_models/app_state/notes_state.ts b/app/assets/javascripts/ui_models/app_state/notes_state.ts index 6688e4e97..3a4e79724 100644 --- a/app/assets/javascripts/ui_models/app_state/notes_state.ts +++ b/app/assets/javascripts/ui_models/app_state/notes_state.ts @@ -108,13 +108,14 @@ export class NotesState { } } - async selectNote(uuid: UuidString): Promise { + async selectNote(uuid: UuidString, userTriggered?: boolean): Promise { const note = this.application.findItem(uuid) as SNNote; if (note) { if ( - this.io.activeModifiers.has(KeyboardModifier.Meta) || - this.io.activeModifiers.has(KeyboardModifier.Ctrl) + userTriggered && + (this.io.activeModifiers.has(KeyboardModifier.Meta) || + this.io.activeModifiers.has(KeyboardModifier.Ctrl)) ) { if (this.selectedNotes[uuid]) { delete this.selectedNotes[uuid]; @@ -124,7 +125,10 @@ export class NotesState { this.lastSelectedNote = note; }); } - } else if (this.io.activeModifiers.has(KeyboardModifier.Shift)) { + } else if ( + userTriggered && + this.io.activeModifiers.has(KeyboardModifier.Shift) + ) { await this.selectNotesRange(note); } else { const shouldSelectNote = diff --git a/app/assets/javascripts/views/notes/notes-view.pug b/app/assets/javascripts/views/notes/notes-view.pug index 7f97da3b8..26287723b 100644 --- a/app/assets/javascripts/views/notes/notes-view.pug +++ b/app/assets/javascripts/views/notes/notes-view.pug @@ -130,7 +130,7 @@ ng-attr-id='note-{{note.uuid}}' ng-repeat='note in self.state.renderedNotes track by note.uuid' ng-class="{'selected' : self.isNoteSelected(note.uuid) }" - ng-click='self.selectNote(note)' + ng-click='self.selectNote(note, true)' ) .note-flags(ng-show='self.noteFlags[note.uuid].length > 0') .flag(ng-class='flag.class', ng-repeat='flag in self.noteFlags[note.uuid]') diff --git a/app/assets/javascripts/views/notes/notes_view.ts b/app/assets/javascripts/views/notes/notes_view.ts index 1708d0db6..1db7ff1b6 100644 --- a/app/assets/javascripts/views/notes/notes_view.ts +++ b/app/assets/javascripts/views/notes/notes_view.ts @@ -305,7 +305,7 @@ class NotesViewCtrl extends PureViewCtrl { private async openNotesContextMenu(e: MouseEvent, note: SNNote) { e.preventDefault(); if (!this.state.selectedNotes[note.uuid]) { - await this.selectNote(note); + await this.selectNote(note, true); } if (this.state.selectedNotes[note.uuid]) { const { clientHeight } = document.documentElement; @@ -395,8 +395,8 @@ class NotesViewCtrl extends PureViewCtrl { } } - async selectNote(note: SNNote): Promise { - await this.appState.notes.selectNote(note.uuid); + async selectNote(note: SNNote, userTriggered?: boolean): Promise { + await this.appState.notes.selectNote(note.uuid, userTriggered); } async createNewNote() {