2020-04-25 23:52:13 +02:00
|
|
|
import FlexContainer from "../widgets/flex_container.js";
|
|
|
|
import NoteTitleWidget from "../widgets/note_title.js";
|
|
|
|
import NoteDetailWidget from "../widgets/note_detail.js";
|
|
|
|
import NoteTreeWidget from "../widgets/note_tree.js";
|
2020-04-26 09:40:02 +02:00
|
|
|
import MobileGlobalButtonsWidget from "../widgets/mobile_widgets/mobile_global_buttons.js";
|
|
|
|
import CloseDetailButtonWidget from "../widgets/mobile_widgets/close_detail_button.js";
|
|
|
|
import MobileDetailMenuWidget from "../widgets/mobile_widgets/mobile_detail_menu.js";
|
|
|
|
import ScreenContainer from "../widgets/mobile_widgets/screen_container.js";
|
2020-03-01 11:04:42 +01:00
|
|
|
|
2020-03-01 18:57:13 +01:00
|
|
|
const MOBILE_CSS = `
|
|
|
|
<style>
|
|
|
|
kbd {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-menu {
|
|
|
|
font-size: larger;
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-button {
|
|
|
|
background: none;
|
|
|
|
border: none;
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: 1.5em;
|
|
|
|
padding-left: 0.5em;
|
|
|
|
padding-right: 0.5em;
|
|
|
|
}
|
|
|
|
</style>`;
|
|
|
|
|
|
|
|
const FANCYTREE_CSS = `
|
|
|
|
<style>
|
|
|
|
.fancytree-custom-icon {
|
|
|
|
font-size: 2em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-title {
|
|
|
|
font-size: 1.5em;
|
|
|
|
margin-left: 0.6em !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-node {
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-node .fancytree-expander:before {
|
|
|
|
font-size: 2em !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
span.fancytree-expander {
|
|
|
|
width: 24px !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-loading span.fancytree-expander {
|
|
|
|
width: 24px;
|
|
|
|
height: 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fancytree-loading span.fancytree-expander:after {
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
margin-top: 4px;
|
|
|
|
border-width: 2px;
|
|
|
|
border-style: solid;
|
|
|
|
}
|
|
|
|
</style>`;
|
|
|
|
|
2020-03-01 11:04:42 +01:00
|
|
|
export default class MobileLayout {
|
|
|
|
getRootWidget(appContext) {
|
2020-03-01 18:57:13 +01:00
|
|
|
return new FlexContainer('row').cssBlock(MOBILE_CSS)
|
2020-03-01 11:04:42 +01:00
|
|
|
.setParent(appContext)
|
|
|
|
.id('root-widget')
|
|
|
|
.css('height', '100vh')
|
2020-03-01 15:19:16 +01:00
|
|
|
.child(new ScreenContainer("tree", 'column')
|
2020-03-01 12:05:10 +01:00
|
|
|
.class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-5 col-md-4 col-lg-4 col-xl-4")
|
2020-03-01 11:53:02 +01:00
|
|
|
.child(new MobileGlobalButtonsWidget())
|
2020-05-02 00:28:40 +02:00
|
|
|
.child(new NoteTreeWidget("main").cssBlock(FANCYTREE_CSS)))
|
2020-03-01 15:19:16 +01:00
|
|
|
.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-8")
|
2020-09-13 21:12:22 +02:00
|
|
|
.child(new FlexContainer('row').overflowing()
|
|
|
|
.css('font-size', 'larger')
|
|
|
|
.css('align-items', 'center')
|
2020-03-01 12:50:02 +01:00
|
|
|
.child(new MobileDetailMenuWidget())
|
2020-09-13 21:12:22 +02:00
|
|
|
.child(new NoteTitleWidget())
|
2020-03-01 12:50:02 +01:00
|
|
|
.child(new CloseDetailButtonWidget()))
|
2020-03-01 18:57:13 +01:00
|
|
|
.child(new NoteDetailWidget()
|
|
|
|
.css('padding', '5px 20px 10px 0')));
|
2020-03-01 11:04:42 +01:00
|
|
|
}
|
2020-09-13 21:12:22 +02:00
|
|
|
}
|