Merge remote-tracking branch 'upstream/develop' into account-menu-react
This commit is contained in:
@@ -108,13 +108,14 @@ export class NotesState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectNote(uuid: UuidString): Promise<void> {
|
async selectNote(uuid: UuidString, userTriggered?: boolean): Promise<void> {
|
||||||
const note = this.application.findItem(uuid) as SNNote;
|
const note = this.application.findItem(uuid) as SNNote;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
if (
|
if (
|
||||||
this.io.activeModifiers.has(KeyboardModifier.Meta) ||
|
userTriggered &&
|
||||||
this.io.activeModifiers.has(KeyboardModifier.Ctrl)
|
(this.io.activeModifiers.has(KeyboardModifier.Meta) ||
|
||||||
|
this.io.activeModifiers.has(KeyboardModifier.Ctrl))
|
||||||
) {
|
) {
|
||||||
if (this.selectedNotes[uuid]) {
|
if (this.selectedNotes[uuid]) {
|
||||||
delete this.selectedNotes[uuid];
|
delete this.selectedNotes[uuid];
|
||||||
@@ -124,7 +125,10 @@ export class NotesState {
|
|||||||
this.lastSelectedNote = note;
|
this.lastSelectedNote = note;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (this.io.activeModifiers.has(KeyboardModifier.Shift)) {
|
} else if (
|
||||||
|
userTriggered &&
|
||||||
|
this.io.activeModifiers.has(KeyboardModifier.Shift)
|
||||||
|
) {
|
||||||
await this.selectNotesRange(note);
|
await this.selectNotesRange(note);
|
||||||
} else {
|
} else {
|
||||||
const shouldSelectNote =
|
const shouldSelectNote =
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
ng-attr-id='note-{{note.uuid}}'
|
ng-attr-id='note-{{note.uuid}}'
|
||||||
ng-repeat='note in self.state.renderedNotes track by note.uuid'
|
ng-repeat='note in self.state.renderedNotes track by note.uuid'
|
||||||
ng-class="{'selected' : self.isNoteSelected(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')
|
.note-flags(ng-show='self.noteFlags[note.uuid].length > 0')
|
||||||
.flag(ng-class='flag.class', ng-repeat='flag in self.noteFlags[note.uuid]')
|
.flag(ng-class='flag.class', ng-repeat='flag in self.noteFlags[note.uuid]')
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
|
|||||||
private async openNotesContextMenu(e: MouseEvent, note: SNNote) {
|
private async openNotesContextMenu(e: MouseEvent, note: SNNote) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!this.state.selectedNotes[note.uuid]) {
|
if (!this.state.selectedNotes[note.uuid]) {
|
||||||
await this.selectNote(note);
|
await this.selectNote(note, true);
|
||||||
}
|
}
|
||||||
if (this.state.selectedNotes[note.uuid]) {
|
if (this.state.selectedNotes[note.uuid]) {
|
||||||
const { clientHeight } = document.documentElement;
|
const { clientHeight } = document.documentElement;
|
||||||
@@ -395,8 +395,8 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectNote(note: SNNote): Promise<void> {
|
async selectNote(note: SNNote, userTriggered?: boolean): Promise<void> {
|
||||||
await this.appState.notes.selectNote(note.uuid);
|
await this.appState.notes.selectNote(note.uuid, userTriggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
async createNewNote() {
|
async createNewNote() {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
.sk-panel-row
|
.sk-panel-row
|
||||||
p.sk-p
|
p.sk-p
|
||||||
| Extensions use an offline messaging system to communicate. Learn more at
|
| Extensions use an offline messaging system to communicate. Learn more at
|
||||||
|
|
|
||||||
a.sk-a.info(
|
a.sk-a.info(
|
||||||
href='https://standardnotes.org/permissions',
|
href='https://standardnotes.org/permissions',
|
||||||
rel='noopener',
|
rel='noopener',
|
||||||
|
|||||||
Reference in New Issue
Block a user