mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
removed auto book as it is no longer needed
This commit is contained in:
parent
67e0e0888e
commit
d19a929237
@ -60,7 +60,6 @@ class TabContext extends Component {
|
|||||||
this.notePath = resolvedNotePath;
|
this.notePath = resolvedNotePath;
|
||||||
this.noteId = noteId;
|
this.noteId = noteId;
|
||||||
|
|
||||||
this.autoBookDisabled = false;
|
|
||||||
this.textPreviewDisabled = false;
|
this.textPreviewDisabled = false;
|
||||||
this.codePreviewDisabled = false;
|
this.codePreviewDisabled = false;
|
||||||
|
|
||||||
|
@ -169,17 +169,6 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
|||||||
|
|
||||||
let type = note.type;
|
let type = note.type;
|
||||||
|
|
||||||
if (type === 'text' && !this.tabContext.autoBookDisabled
|
|
||||||
&& note.hasChildren()
|
|
||||||
&& utils.isDesktop()) {
|
|
||||||
|
|
||||||
const noteComplement = await this.tabContext.getNoteComplement();
|
|
||||||
|
|
||||||
if (utils.isHtmlEmpty(noteComplement.content)) {
|
|
||||||
type = 'book';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type === 'text' && !this.tabContext.textPreviewDisabled) {
|
if (type === 'text' && !this.tabContext.textPreviewDisabled) {
|
||||||
const noteComplement = await this.tabContext.getNoteComplement();
|
const noteComplement = await this.tabContext.getNoteComplement();
|
||||||
|
|
||||||
@ -308,12 +297,6 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
|||||||
this.spacedUpdate.updateNowIfNecessary();
|
this.spacedUpdate.updateNowIfNecessary();
|
||||||
}
|
}
|
||||||
|
|
||||||
autoBookDisabledEvent({tabContext}) {
|
|
||||||
if (this.isTab(tabContext.tabId)) {
|
|
||||||
this.refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
textPreviewDisabledEvent({tabContext}) {
|
textPreviewDisabledEvent({tabContext}) {
|
||||||
if (this.isTab(tabContext.tabId)) {
|
if (this.isTab(tabContext.tabId)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
@ -27,7 +27,8 @@ export default class NoteListWidget extends TabAwareWidget {
|
|||||||
&& (
|
&& (
|
||||||
['book', 'search', 'code'].includes(this.note.type)
|
['book', 'search', 'code'].includes(this.note.type)
|
||||||
|| (this.note.type === 'text' && this.note.hasChildren())
|
|| (this.note.type === 'text' && this.note.hasChildren())
|
||||||
);
|
)
|
||||||
|
&& !this.note.hasLabel('hideChildrenOverview');
|
||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
@ -92,12 +93,6 @@ export default class NoteListWidget extends TabAwareWidget {
|
|||||||
this.checkRenderStatus();
|
this.checkRenderStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
autoBookDisabledEvent({tabContext}) {
|
|
||||||
if (this.isTab(tabContext.tabId)) {
|
|
||||||
this.refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
notesReloadedEvent({noteIds}) {
|
notesReloadedEvent({noteIds}) {
|
||||||
if (noteIds.includes(this.noteId)) {
|
if (noteIds.includes(this.noteId)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
@ -15,11 +15,6 @@ const TPL = `
|
|||||||
<div class="note-detail-book-empty-help alert alert-warning" style="margin: 50px; padding: 20px;">
|
<div class="note-detail-book-empty-help alert alert-warning" style="margin: 50px; padding: 20px;">
|
||||||
This note of type Book doesn't have any child notes so there's nothing to display. See <a href="https://github.com/zadam/trilium/wiki/Book-note">wiki</a> for details.
|
This note of type Book doesn't have any child notes so there's nothing to display. See <a href="https://github.com/zadam/trilium/wiki/Book-note">wiki</a> for details.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="note-detail-book-auto-help">
|
|
||||||
This note doesn't have any content so we display its children.
|
|
||||||
<br> Click <a href="javascript:">here</a> if you want to add some text.
|
|
||||||
</div>
|
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
export default class BookTypeWidget extends TypeWidget {
|
export default class BookTypeWidget extends TypeWidget {
|
||||||
@ -29,17 +24,9 @@ export default class BookTypeWidget extends TypeWidget {
|
|||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.contentSized();
|
this.contentSized();
|
||||||
this.$helpNoChildren = this.$widget.find('.note-detail-book-empty-help');
|
this.$helpNoChildren = this.$widget.find('.note-detail-book-empty-help');
|
||||||
|
|
||||||
this.$helpAutoBook = this.$widget.find('.note-detail-book-auto-help');
|
|
||||||
this.$helpAutoBook.find('a').on('click', () => {
|
|
||||||
this.tabContext.autoBookDisabled = true;
|
|
||||||
|
|
||||||
this.triggerEvent('autoBookDisabled', {tabContext: this.tabContext});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async doRefresh(note) {
|
async doRefresh(note) {
|
||||||
this.$helpNoChildren.toggle(!this.note.hasChildren());
|
this.$helpNoChildren.toggle(!this.note.hasChildren());
|
||||||
this.$helpAutoBook.toggle(this.note.type !== 'book');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ const TPL = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.note-detail-code-editor {
|
.note-detail-code-editor {
|
||||||
min-height: 300px;
|
min-height: 50px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -62,8 +62,7 @@ const TPL = `
|
|||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
/* This is because with empty content height of editor is 0 and it's impossible to click into it */
|
min-height: 50px;
|
||||||
min-height: 300px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -45,12 +45,6 @@ export default class TypeWidget extends TabAwareWidget {
|
|||||||
this.$widget.scrollTop(0);
|
this.$widget.scrollTop(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
autoBookDisabledEvent({tabContext}) {
|
|
||||||
if (this.isTab(tabContext.tabId)) {
|
|
||||||
this.refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
textPreviewDisabledEvent({tabContext}) {
|
textPreviewDisabledEvent({tabContext}) {
|
||||||
if (this.isTab(tabContext.tabId)) {
|
if (this.isTab(tabContext.tabId)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user