mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-25 11:45:58 +00:00
Fixes #45
This commit is contained in:
parent
17d4533e45
commit
eacff3a9f0
@ -72,4 +72,19 @@ window.setupPageShow = module.exports = function (pageId) {
|
||||
goToText(text);
|
||||
}
|
||||
|
||||
// Get current tree's width
|
||||
var bookTreeWidth = $(".book-tree").width();
|
||||
// Get header height
|
||||
var headerHeight = $("#header").height() + $(".faded-small").height();
|
||||
$(window).scroll(function () {
|
||||
if($(window).scrollTop() > headerHeight){
|
||||
// Begin to scroll
|
||||
$(".book-tree").width(bookTreeWidth);
|
||||
$(".book-tree").css("position", "fixed");
|
||||
$(".book-tree").css("top", 0);
|
||||
} else {
|
||||
// Lock it back in place
|
||||
$(".book-tree").css("position", "relative");
|
||||
}
|
||||
})
|
||||
};
|
Loading…
Reference in New Issue
Block a user