mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
tabs WIP
This commit is contained in:
parent
ff41904d72
commit
32439ed006
@ -42,6 +42,7 @@ class NoteContext {
|
||||
this.$childrenOverview = this.$noteTabContent.find(".children-overview");
|
||||
this.$scriptArea = this.$noteTabContent.find(".note-detail-script-area");
|
||||
this.$savedIndicator = this.$noteTabContent.find(".saved-indicator");
|
||||
this.noteChangeDisabled = false;
|
||||
this.isNoteChanged = false;
|
||||
this.components = {};
|
||||
|
||||
@ -116,7 +117,7 @@ class NoteContext {
|
||||
}
|
||||
|
||||
noteChanged() {
|
||||
if (noteChangeDisabled) {
|
||||
if (this.noteChangeDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,6 @@ import importDialog from "../dialogs/import.js";
|
||||
const $noteTabContentsContainer = $("#note-tab-container");
|
||||
const $savedIndicator = $(".saved-indicator");
|
||||
|
||||
let noteChangeDisabled = false;
|
||||
|
||||
let detailLoadedListeners = [];
|
||||
|
||||
function getActiveNote() {
|
||||
@ -163,7 +161,7 @@ async function loadNoteDetail(noteId, newTab = false) {
|
||||
|
||||
ctx.updateNoteView();
|
||||
|
||||
noteChangeDisabled = true;
|
||||
ctx.noteChangeDisabled = true;
|
||||
|
||||
try {
|
||||
ctx.$noteTitle.val(ctx.note.title);
|
||||
@ -192,7 +190,7 @@ async function loadNoteDetail(noteId, newTab = false) {
|
||||
await ctx.getComponent(ctx.note.type).show(ctx);
|
||||
}
|
||||
finally {
|
||||
noteChangeDisabled = false;
|
||||
ctx.noteChangeDisabled = false;
|
||||
}
|
||||
|
||||
treeService.setBranchBackgroundBasedOnProtectedStatus(noteId);
|
||||
|
@ -16,9 +16,9 @@ class NoteDetailCode {
|
||||
this.$component = ctx.$noteTabContent.find('.note-detail-code');
|
||||
this.$executeScriptButton = ctx.$noteTabContent.find(".execute-script-button");
|
||||
|
||||
utils.bindShortcut("ctrl+return", this.executeCurrentNote);
|
||||
utils.bindShortcut("ctrl+return", () => this.executeCurrentNote());
|
||||
|
||||
this.$executeScriptButton.click(this.executeCurrentNote);
|
||||
this.$executeScriptButton.click(() => this.executeCurrentNote());
|
||||
}
|
||||
|
||||
async show() {
|
||||
@ -50,7 +50,7 @@ class NoteDetailCode {
|
||||
lineWrapping: true
|
||||
});
|
||||
|
||||
this.onNoteChange(noteDetailService.noteChanged);
|
||||
this.onNoteChange(() => this.ctx.noteChanged());
|
||||
}
|
||||
|
||||
this.$component.show();
|
||||
|
@ -45,7 +45,7 @@ class NoteDetailText {
|
||||
placeholder: "Type the content of your note here ..."
|
||||
});
|
||||
|
||||
this.onNoteChange(noteDetailService.noteChanged);
|
||||
this.onNoteChange(() => this.ctx.noteChanged());
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +86,6 @@ class NoteDetailText {
|
||||
this.textEditor.model.document.on('change:data', func);
|
||||
}
|
||||
|
||||
|
||||
cleanup() {
|
||||
if (this.textEditor) {
|
||||
this.textEditor.setData('');
|
||||
|
Loading…
x
Reference in New Issue
Block a user