sidebar skeleton

This commit is contained in:
zadam 2019-07-21 10:17:08 +02:00
parent d54f848572
commit 5283b489dc
8 changed files with 152 additions and 31 deletions

View File

@ -42,6 +42,7 @@ import noteAutocompleteService from './services/note_autocomplete.js';
import macInit from './services/mac_init.js';
import cssLoader from './services/css_loader.js';
import dateNoteService from './services/date_notes.js';
import sidebarService from './services/sidebar.js';
window.glob.isDesktop = utils.isDesktop;
window.glob.isMobile = utils.isMobile;

View File

@ -0,0 +1,25 @@
class Sidebar {
/**
* @param {TabContext} ctx
*/
constructor(ctx) {
this.ctx = ctx;
this.$sidebar = ctx.$tabContent.find(".note-detail-sidebar");
this.$showSideBarButton = this.ctx.$tabContent.find(".show-sidebar-button");
this.$showSideBarButton.hide();
this.$hideSidebarButton = this.$sidebar.find(".hide-sidebar-button");
this.$hideSidebarButton.click(() => {
this.$sidebar.hide();
this.$showSideBarButton.show();
});
this.$showSideBarButton.click(() => {
this.$sidebar.show();
this.$showSideBarButton.hide();
})
}
}
export default Sidebar;

View File

@ -18,6 +18,7 @@ import noteDetailRelationMap from "./note_detail_relation_map.js";
import noteDetailProtectedSession from "./note_detail_protected_session.js";
import protectedSessionService from "./protected_session.js";
import linkService from "./link.js";
import Sidebar from "./sidebar.js";
const $tabContentsContainer = $("#note-tab-container");
@ -59,6 +60,7 @@ class TabContext {
this.noteChangeDisabled = false;
this.isNoteChanged = false;
this.attributes = new Attributes(this);
this.sidebar = new Sidebar(this);
if (utils.isDesktop()) {
this.noteType = new NoteTypeContext(this);

View File

@ -103,11 +103,49 @@ ul.fancytree-container {
}
.note-tab-content {
display: flex;
flex-direction: row;
height: 100%;
width: 100%;
}
.note-detail-content {
display: flex;
flex-direction: column;
height: 100%;
}
.note-detail-sidebar {
min-width: 300px;
overflow: auto;
padding-top: 12px;
padding-left: 7px;
}
.note-detail-sidebar .card {
border: 0;
}
.note-detail-sidebar .card-header {
background: inherit;
padding: 0;
border: 0;
}
.note-detail-sidebar .card-header button {
}
.note-detail-sidebar .card-header h5 {
font-size: 1rem;
}
.note-detail-sidebar .card-body {
max-width: 300px;
padding: 8px;
border: 0;
}
.note-detail-component-wrapper {
flex-grow: 100;
position: relative;

View File

@ -6,7 +6,7 @@
</head>
<body class="desktop theme-<%= theme %>" style="--main-font-size: <%= mainFontSize %>%; --tree-font-size: <%= treeFontSize %>%; --detail-font-size: <%= detailFontSize %>%;">
<noscript>Trilium requires JavaScript to be enabled.</noscript>
<div id="container" style="display: none; grid-template-columns: minmax(<%= leftPaneMinWidth %>px, <%= leftPaneWidthPercent %>fr) minmax(0, <%= rightPaneWidthPercent %>fr)">
<div id="container" style="display: none; grid-template-columns: <%= leftPaneWidthPercent %>fr <%= rightPaneWidthPercent %>fr">
<div id="header" class="hide-toggle">
<div id="history-navigation" style="display: none;">
<a id="history-back-button" title="Go to previous note." class="icon-action jam jam-arrow-square-left"></a>
@ -106,7 +106,7 @@
</div>
</div>
<div id="left-pane" class="hide-toggle">
<div id="left-pane" class="hide-toggle" style="resize: horizontal; overflow: scroll;">
<div id="global-buttons">
<a id="create-top-level-note-button" title="Create new top level note" class="icon-action jam jam-plus-circle"></a>

49
src/views/sidebar.ejs Normal file
View File

@ -0,0 +1,49 @@
<div class="note-detail-sidebar">
<div style="text-align: center; margin-bottom: 10px;">
<button class="hide-sidebar-button" style="background: none; border: none;">hide sidebar <span class="jam jam-chevron-right"></span></button>
</div>
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-sm" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-sm collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-sm collapsed" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>

View File

@ -4,42 +4,46 @@
<div id="note-tab-container">
<div class="note-tab-content note-tab-content-template">
<% include title.ejs %>
<div class="note-detail-content">
<% include title.ejs %>
<div class="note-detail-script-area"></div>
<div class="note-detail-script-area"></div>
<table class="note-detail-promoted-attributes"></table>
<table class="note-detail-promoted-attributes"></table>
<div class="note-detail-component-wrapper">
<div class="note-detail-text note-detail-component">
<div class="note-detail-text-editor" tabindex="10000"></div>
<div class="note-detail-component-wrapper">
<div class="note-detail-text note-detail-component">
<div class="note-detail-text-editor" tabindex="10000"></div>
</div>
<div class="note-detail-code note-detail-component">
<div class="note-detail-code-editor"></div>
</div>
<% include details/empty.ejs %>
<% include details/search.ejs %>
<% include details/render.ejs %>
<% include details/file.ejs %>
<% include details/image.ejs %>
<% include details/relation_map.ejs %>
<% include details/protected_session_password.ejs %>
<div class="children-overview"></div>
</div>
<div class="note-detail-code note-detail-component">
<div class="note-detail-code-editor"></div>
<div class="attribute-list">
<button class="btn btn-sm show-attributes-button">Attributes:</button>
<span class="attribute-list-inner"></span>
</div>
<% include details/empty.ejs %>
<% include details/search.ejs %>
<% include details/render.ejs %>
<% include details/file.ejs %>
<% include details/image.ejs %>
<% include details/relation_map.ejs %>
<% include details/protected_session_password.ejs %>
<div class="children-overview"></div>
</div>
<div class="attribute-list">
<button class="btn btn-sm show-attributes-button">Attributes:</button>
<span class="attribute-list-inner"></span>
</div>
<% include sidebar.ejs %>
</div>
</div>

View File

@ -73,6 +73,8 @@
<a class="dropdown-item show-note-info-button">Note info</a>
</div>
</div>
<button class="btn btn-sm icon-button jam jam-chevron-left show-sidebar-button" title="Show sidebar"></button>
</div>
</div>
</div>