Apply note wrapper on mobile (#6847)

This commit is contained in:
Elian Doran 2025-09-07 10:59:28 +03:00 committed by GitHub
commit 5eae51a1b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 23 deletions

View File

@ -22,6 +22,7 @@ import FloatingButtons from "../widgets/FloatingButtons.jsx";
import { MOBILE_FLOATING_BUTTONS } from "../widgets/FloatingButtonsDefinitions.jsx"; import { MOBILE_FLOATING_BUTTONS } from "../widgets/FloatingButtonsDefinitions.jsx";
import ToggleSidebarButton from "../widgets/mobile_widgets/toggle_sidebar_button.jsx"; import ToggleSidebarButton from "../widgets/mobile_widgets/toggle_sidebar_button.jsx";
import CloseZenModeButton from "../widgets/close_zen_button.js"; import CloseZenModeButton from "../widgets/close_zen_button.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";
const MOBILE_CSS = ` const MOBILE_CSS = `
@ -131,30 +132,33 @@ export default class MobileLayout {
.child(new FlexContainer("column").filling().id("mobile-sidebar-wrapper").child(new QuickSearchWidget()).child(new NoteTreeWidget().cssBlock(FANCYTREE_CSS))) .child(new FlexContainer("column").filling().id("mobile-sidebar-wrapper").child(new QuickSearchWidget()).child(new NoteTreeWidget().cssBlock(FANCYTREE_CSS)))
) )
.child( .child(
new ScreenContainer("detail", "column") new ScreenContainer("detail", "row")
.id("detail-container") .id("detail-container")
.class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-7 col-md-8 col-lg-9") .class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-7 col-md-8 col-lg-9")
.child( .child(
new FlexContainer("row") new NoteWrapperWidget()
.contentSized() .child(
.css("font-size", "larger") new FlexContainer("row")
.css("align-items", "center") .contentSized()
.child(<ToggleSidebarButton />) .css("font-size", "larger")
.child(<NoteTitleWidget />) .css("align-items", "center")
.child(<MobileDetailMenu />) .child(<ToggleSidebarButton />)
.child(<NoteTitleWidget />)
.child(<MobileDetailMenu />)
)
.child(<SharedInfoWidget />)
.child(<FloatingButtons items={MOBILE_FLOATING_BUTTONS} />)
.child(new PromotedAttributesWidget())
.child(
new ScrollingContainer()
.filling()
.contentSized()
.child(new NoteDetailWidget())
.child(new NoteListWidget(false))
.child(<FilePropertiesWrapper />)
)
.child(<MobileEditorToolbar />)
) )
.child(<SharedInfoWidget />)
.child(<FloatingButtons items={MOBILE_FLOATING_BUTTONS} />)
.child(new PromotedAttributesWidget())
.child(
new ScrollingContainer()
.filling()
.contentSized()
.child(new NoteDetailWidget())
.child(new NoteListWidget(false))
.child(<FilePropertiesWrapper />)
)
.child(<MobileEditorToolbar />)
) )
) )
.child( .child(

View File

@ -23,15 +23,21 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
this.refresh(); this.refresh();
} }
noteSwitchedAndActivatedEvent() { noteSwitchedAndActivatedEvent({ noteContext }: EventData<"setNoteContext">) {
this.noteContext = noteContext;
this.refresh(); this.refresh();
} }
noteSwitchedEvent() { noteSwitchedEvent({ noteContext }: EventData<"setNoteContext">) {
this.noteContext = noteContext;
this.refresh(); this.refresh();
} }
activeContextChangedEvent() { activeContextChangedEvent({ noteContext }: EventData<"setNoteContext">) {
this.noteContext = noteContext;
this.refresh(); this.refresh();
} }