refactored TabContext => NoteContext

This commit is contained in:
zadam
2021-05-22 12:35:41 +02:00
parent 274cf7312c
commit 79a85a0aa7
60 changed files with 187 additions and 187 deletions

View File

@@ -74,17 +74,17 @@ export default class Entrypoints extends Component {
await ws.waitForMaxKnownEntityChangeId();
const hoistedNoteId = appContext.tabManager.getActiveNoteContext()
? appContext.tabManager.getActiveNoteContext().hoistedNoteId
const hoistedNoteId = appContext.tabManager.getActiveContext()
? appContext.tabManager.getActiveContext().hoistedNoteId
: 'root';
await appContext.tabManager.openTabWithNote(note.noteId, true, null, hoistedNoteId);
await appContext.tabManager.openContextWithNote(note.noteId, true, null, hoistedNoteId);
appContext.triggerEvent('focusAndSelectTitle');
}
async toggleNoteHoistingCommand() {
const noteContext = appContext.tabManager.getActiveNoteContext();
const noteContext = appContext.tabManager.getActiveContext();
if (noteContext.note.noteId === noteContext.hoistedNoteId) {
await noteContext.unhoist();
@@ -95,7 +95,7 @@ export default class Entrypoints extends Component {
}
async hoistNoteCommand({noteId}) {
const noteContext = appContext.tabManager.getActiveNoteContext();
const noteContext = appContext.tabManager.getActiveContext();
if (noteContext.hoistedNoteId !== noteId) {
await noteContext.setHoistedNoteId(noteId);
@@ -103,7 +103,7 @@ export default class Entrypoints extends Component {
}
async unhoistCommand() {
const activeNoteContext = appContext.tabManager.getActiveNoteContext();
const activeNoteContext = appContext.tabManager.getActiveContext();
if (activeNoteContext) {
activeNoteContext.unhoist();
@@ -194,7 +194,7 @@ export default class Entrypoints extends Component {
}
async runActiveNoteCommand() {
const noteContext = appContext.tabManager.getActiveNoteContext();
const noteContext = appContext.tabManager.getActiveContext();
const note = noteContext.note;
// ctrl+enter is also used elsewhere so make sure we're running only when appropriate
@@ -220,7 +220,7 @@ export default class Entrypoints extends Component {
$(".tooltip").removeClass("show");
}
tabNoteSwitchedEvent() {
noteSwitchedEvent() {
this.hideAllTooltips();
}