mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 08:58:58 +01:00
chore(react/type_widget): fix sizing
This commit is contained in:
parent
6bcce08042
commit
e576fa03da
@ -1,6 +1,5 @@
|
|||||||
import FlexContainer from "../widgets/containers/flex_container.js";
|
import FlexContainer from "../widgets/containers/flex_container.js";
|
||||||
import NoteTitleWidget from "../widgets/note_title.js";
|
import NoteTitleWidget from "../widgets/note_title.js";
|
||||||
import NoteDetailWidget from "../widgets/note_detail.js";
|
|
||||||
import QuickSearchWidget from "../widgets/quick_search.js";
|
import QuickSearchWidget from "../widgets/quick_search.js";
|
||||||
import NoteTreeWidget from "../widgets/note_tree.js";
|
import NoteTreeWidget from "../widgets/note_tree.js";
|
||||||
import ScreenContainer from "../widgets/mobile_widgets/screen_container.js";
|
import ScreenContainer from "../widgets/mobile_widgets/screen_container.js";
|
||||||
@ -24,6 +23,7 @@ import CloseZenModeButton from "../widgets/close_zen_button.js";
|
|||||||
import NoteWrapperWidget from "../widgets/note_wrapper.js";
|
import NoteWrapperWidget from "../widgets/note_wrapper.js";
|
||||||
import MobileDetailMenu from "../widgets/mobile_widgets/mobile_detail_menu.js";
|
import MobileDetailMenu from "../widgets/mobile_widgets/mobile_detail_menu.js";
|
||||||
import NoteList from "../widgets/collections/NoteList.jsx";
|
import NoteList from "../widgets/collections/NoteList.jsx";
|
||||||
|
import NoteDetail from "../widgets/NoteDetail.jsx";
|
||||||
|
|
||||||
const MOBILE_CSS = `
|
const MOBILE_CSS = `
|
||||||
<style>
|
<style>
|
||||||
@ -153,7 +153,7 @@ export default class MobileLayout {
|
|||||||
new ScrollingContainer()
|
new ScrollingContainer()
|
||||||
.filling()
|
.filling()
|
||||||
.contentSized()
|
.contentSized()
|
||||||
.child(new NoteDetailWidget())
|
.child(<NoteDetail />)
|
||||||
.child(<NoteList />)
|
.child(<NoteList />)
|
||||||
.child(<FilePropertiesWrapper />)
|
.child(<FilePropertiesWrapper />)
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
.note-detail {
|
.component.note-detail {
|
||||||
font-family: var(--detail-font-family);
|
font-family: var(--detail-font-family);
|
||||||
font-size: var(--detail-font-size);
|
font-size: var(--detail-font-size);
|
||||||
|
contain: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-detail.full-height {
|
.note-detail.full-height {
|
||||||
contain: none;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note-detail > * {
|
||||||
|
contain: none;
|
||||||
|
}
|
||||||
@ -25,6 +25,9 @@ type ExtendedNoteType = Exclude<NoteType, "launcher" | "text" | "code"> | "empty
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The note detail is in charge of rendering the content of a note, by determining its type (e.g. text, code) and using the appropriate view widget.
|
* The note detail is in charge of rendering the content of a note, by determining its type (e.g. text, code) and using the appropriate view widget.
|
||||||
|
*
|
||||||
|
* Apart from that:
|
||||||
|
* - It applies a full-height style depending on the content type (e.g. canvas notes).
|
||||||
*/
|
*/
|
||||||
export default function NoteDetail() {
|
export default function NoteDetail() {
|
||||||
const { note, type, noteContext, parentComponent } = useNoteInfo();
|
const { note, type, noteContext, parentComponent } = useNoteInfo();
|
||||||
|
|||||||
@ -81,11 +81,6 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
|
||||||
this.$widget = $(TPL);
|
|
||||||
this.contentSized();
|
|
||||||
}
|
|
||||||
|
|
||||||
async refresh() {
|
async refresh() {
|
||||||
this.type = await this.getWidgetType();
|
this.type = await this.getWidgetType();
|
||||||
this.mime = this.note?.mime;
|
this.mime = this.note?.mime;
|
||||||
|
|||||||
@ -16,8 +16,6 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
|
|||||||
static getType() {}
|
static getType() {}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.contentSized();
|
|
||||||
|
|
||||||
return super.doRender();
|
return super.doRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user