mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Merge branch 'master' into 2019-design
This commit is contained in:
@ -123,20 +123,21 @@ class PageDisplay {
|
||||
|
||||
setupStickySidebar() {
|
||||
// Make the sidebar stick in view on scroll
|
||||
let $window = $(window);
|
||||
let $sidebar = $("#sidebar .scroll-body");
|
||||
let $bookTreeParent = $sidebar.parent();
|
||||
const $window = $(window);
|
||||
const $sidebar = $("#sidebar .scroll-body");
|
||||
const $sidebarContainer = $sidebar.parent();
|
||||
const sidebarHeight = $sidebar.height() + 32;
|
||||
|
||||
// Check the page is scrollable and the content is taller than the tree
|
||||
let pageScrollable = ($(document).height() > ($window.height() + 40)) && ($sidebar.height() < $('.page-content').height());
|
||||
const pageScrollable = ($(document).height() > ($window.height() + 40)) && (sidebarHeight < $('.page-content').height());
|
||||
|
||||
// Get current tree's width and header height
|
||||
let headerHeight = $("#header").height() + $(".toolbar").height();
|
||||
const headerHeight = $("#header").height() + $(".toolbar").height();
|
||||
let isFixed = $window.scrollTop() > headerHeight;
|
||||
|
||||
// Fix the tree as a sidebar
|
||||
function stickTree() {
|
||||
$sidebar.css('width', $bookTreeParent.width());
|
||||
$sidebar.width($sidebarContainer.width() + 15);
|
||||
$sidebar.addClass("fixed");
|
||||
isFixed = true;
|
||||
}
|
||||
|
@ -16,6 +16,14 @@ body {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.flex-fill {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.flex.sidebar + .flex.content {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.print-hidden {
|
||||
display: none;
|
||||
}
|
||||
@ -31,4 +39,8 @@ h2 {
|
||||
line-height: 1;
|
||||
margin-top: 0.6em;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
.comments-container {
|
||||
display: none;
|
||||
}
|
@ -35,7 +35,7 @@
|
||||
@endif
|
||||
</td>
|
||||
<td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else {{ trans('common.deleted_user') }} @endif</td>
|
||||
<td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
|
||||
<td><small>{{ $revision->created_at->formatLocalized('%e %B %Y %H:%M:%S') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
|
||||
<td>{{ $revision->summary }}</td>
|
||||
<td class="actions">
|
||||
<a href="{{ $revision->getUrl('changes') }}" target="_blank">{{ trans('entities.pages_revisions_changes') }}</a>
|
||||
|
Reference in New Issue
Block a user