Skip to content

Commit

Permalink
Remember scrollTop on autohide, see #106 (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelatx authored and Hirse committed Oct 22, 2018
1 parent 13be6de commit 1ef0a91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Autohide.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define(function (require, exports, module) {
var $mainView = $(".main-view");
var isExposed = false;
var sidebarPlusTransitionRemoved = false;
var scrollTop;


/**
Expand Down Expand Up @@ -94,6 +95,9 @@ define(function (require, exports, module) {
removeSidebarPlusTransition();
hidePlaceholder();
OutlineManager.showOutline();
if (scrollTop) {
$("#outline-list").scrollTop(scrollTop);
}
var $outline = $("#outline");
$outline.css("visibility", "hidden");
isExposed = true;
Expand All @@ -105,6 +109,7 @@ define(function (require, exports, module) {
*/
function coverOutline() {
if (isExposed) {
scrollTop = $("#outline-list").scrollTop();
removeSidebarPlusTransition();
OutlineManager.hideOutline();
showPlaceholder();
Expand Down

0 comments on commit 1ef0a91

Please sign in to comment.