mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
feat(mobile): implement dismiss region of sidebar
This commit is contained in:
parent
61ccee27f2
commit
b00ca234f5
@ -127,9 +127,13 @@ export default class MobileLayout {
|
|||||||
.css('padding-left', "0")
|
.css('padding-left', "0")
|
||||||
.css('padding-right', "0")
|
.css('padding-right', "0")
|
||||||
.css('contain', 'content')
|
.css('contain', 'content')
|
||||||
.child(new QuickSearchWidget())
|
.child(new FlexContainer("column")
|
||||||
.child(new NoteTreeWidget()
|
.filling()
|
||||||
.cssBlock(FANCYTREE_CSS)))
|
.id("mobile-sidebar-wrapper")
|
||||||
|
.child(new QuickSearchWidget())
|
||||||
|
.child(new NoteTreeWidget()
|
||||||
|
.cssBlock(FANCYTREE_CSS))
|
||||||
|
))
|
||||||
.child(new ScreenContainer("detail", "column")
|
.child(new ScreenContainer("detail", "column")
|
||||||
.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")
|
||||||
.css("padding-left", "0")
|
.css("padding-left", "0")
|
||||||
|
@ -8,11 +8,6 @@ export default class ScreenContainer extends FlexContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
activeScreenChangedEvent({activeScreen}) {
|
activeScreenChangedEvent({activeScreen}) {
|
||||||
if (activeScreen === this.screenName) {
|
|
||||||
this.$widget.removeClass('d-none');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.$widget.addClass('d-none');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,14 @@ export default class SidebarContainer extends FlexContainer {
|
|||||||
this.screenName = screenName;
|
this.screenName = screenName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doRender() {
|
||||||
|
super.doRender();
|
||||||
|
|
||||||
|
this.$widget.on("click", () => {
|
||||||
|
this.triggerEvent('activeScreenChanged', "detail");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
activeScreenChangedEvent({activeScreen}) {
|
activeScreenChangedEvent({activeScreen}) {
|
||||||
if (activeScreen === this.screenName) {
|
if (activeScreen === this.screenName) {
|
||||||
this.$widget.addClass('show');
|
this.$widget.addClass('show');
|
||||||
|
@ -1176,14 +1176,18 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu {
|
|||||||
#mobile-sidebar-container {
|
#mobile-sidebar-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
|
||||||
bottom: var(--launcher-pane-size);
|
bottom: var(--launcher-pane-size);
|
||||||
padding-top: env(safe-area-inset-top);
|
padding-top: env(safe-area-inset-top);
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
background: var(--main-background-color);
|
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
transition: transform 250ms ease-in-out;
|
transition: transform 250ms ease-in-out;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
}
|
||||||
|
|
||||||
|
#mobile-sidebar-wrapper {
|
||||||
|
width: 85vw;
|
||||||
|
background: var(--main-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
#mobile-sidebar-container.show {
|
#mobile-sidebar-container.show {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user