mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 08:45:50 +01:00
layout changes
This commit is contained in:
@@ -21,7 +21,7 @@ const TPL = `
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="note-type-container" style="display: flex">
|
||||
<div class="note-type-container">
|
||||
<span>Note type:</span>
|
||||
</div>
|
||||
|
||||
@@ -32,8 +32,8 @@ export default class BasicPropertiesWidget extends NoteContextAwareWidget {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.noteTypeWidget = new NoteTypeWidget();
|
||||
this.protectedNoteSwitchWidget = new ProtectedNoteSwitchWidget();
|
||||
this.noteTypeWidget = new NoteTypeWidget().contentSized();
|
||||
this.protectedNoteSwitchWidget = new ProtectedNoteSwitchWidget().contentSized();
|
||||
|
||||
this.child(this.noteTypeWidget, this.protectedNoteSwitchWidget);
|
||||
}
|
||||
@@ -52,6 +52,7 @@ export default class BasicPropertiesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$widget.find(".note-type-container").append(this.noteTypeWidget.render());
|
||||
this.$widget.find(".protected-note-switch-container").append(this.protectedNoteSwitchWidget.render());
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
||||
import server from "../../services/server.js";
|
||||
import attributeService from "../../services/attributes.js";
|
||||
|
||||
const TPL = `
|
||||
@@ -58,6 +57,7 @@ export default class BookPropertiesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$viewTypeSelect = this.$widget.find('.view-type-select');
|
||||
this.$viewTypeSelect.on('change', () => this.toggleViewType(this.$viewTypeSelect.val()));
|
||||
|
||||
@@ -70,6 +70,7 @@ export default class FilePropertiesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
this.$fileNoteId = this.$widget.find(".file-note-id");
|
||||
this.$fileName = this.$widget.find(".file-filename");
|
||||
this.$fileType = this.$widget.find(".file-filetype");
|
||||
|
||||
@@ -52,6 +52,7 @@ export default class ImagePropertiesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
this.$copyToClipboardButton = this.$widget.find(".image-copy-to-clipboard");
|
||||
this.$uploadNewRevisionButton = this.$widget.find(".image-upload-new-revision");
|
||||
this.$uploadNewRevisionInput = this.$widget.find(".image-upload-new-revision-input");
|
||||
|
||||
@@ -38,6 +38,7 @@ export default class InheritedAttributesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$container = this.$widget.find('.inherited-attributes-container');
|
||||
this.$widget.append(this.attributeDetailWidget.render());
|
||||
|
||||
@@ -52,6 +52,7 @@ export default class LinkMapWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
this.$container = this.$widget.find(".link-map-container");
|
||||
|
||||
this.openState = 'small';
|
||||
@@ -177,7 +178,7 @@ export default class LinkMapWidget extends NoteContextAwareWidget {
|
||||
renderData(data, zoomToFit = true, zoomPadding = 10) {
|
||||
this.graph.graphData(data);
|
||||
|
||||
if (zoomToFit) {
|
||||
if (zoomToFit && data.nodes.length > 1) {
|
||||
setTimeout(() => this.graph.zoomToFit(400, zoomPadding), 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ export default class NoteInfoWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$noteId = this.$widget.find(".note-info-note-id");
|
||||
this.$dateCreated = this.$widget.find(".note-info-date-created");
|
||||
|
||||
@@ -50,6 +50,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$notePathIntro = this.$widget.find(".note-path-intro");
|
||||
this.$notePathList = this.$widget.find(".note-path-list");
|
||||
|
||||
@@ -30,6 +30,7 @@ export default class NotePropertiesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$pageUrl = this.$widget.find('.page-url');
|
||||
}
|
||||
|
||||
@@ -25,8 +25,13 @@ export default class OwnedAttributeListWidget extends NoteContextAwareWidget {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.attributeDetailWidget = new AttributeDetailWidget().setParent(this);
|
||||
this.attributeEditorWidget = new AttributeEditorWidget(this.attributeDetailWidget).setParent(this);
|
||||
this.attributeDetailWidget = new AttributeDetailWidget()
|
||||
.contentSized()
|
||||
.setParent(this);
|
||||
|
||||
this.attributeEditorWidget = new AttributeEditorWidget(this.attributeDetailWidget)
|
||||
.contentSized()
|
||||
.setParent(this);
|
||||
|
||||
this.child(this.attributeEditorWidget, this.attributeDetailWidget);
|
||||
}
|
||||
@@ -41,6 +46,7 @@ export default class OwnedAttributeListWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$widget.find('.attr-editor-placeholder').replaceWith(this.attributeEditorWidget.render());
|
||||
this.$widget.append(this.attributeDetailWidget.render());
|
||||
|
||||
@@ -37,6 +37,7 @@ const TPL = `
|
||||
export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
this.$container = this.$widget.find(".promoted-attributes-container");
|
||||
}
|
||||
|
||||
|
||||
@@ -223,9 +223,9 @@ export default class SearchDefinitionWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
this.$component = this.$widget.find('.search-definition-widget');
|
||||
|
||||
|
||||
this.$widget.on('click', '[data-search-option-add]', async event => {
|
||||
const searchOptionName = $(event.target).attr('data-search-option-add');
|
||||
const clazz = OPTION_CLASSES.find(SearchOptionClass => SearchOptionClass.optionName === searchOptionName);
|
||||
|
||||
@@ -47,6 +47,7 @@ export default class SimilarNotesWidget extends NoteContextAwareWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
|
||||
this.$similarNotesWrapper = this.$widget.find(".similar-notes-wrapper");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user