Skip to content

Commit

Permalink
Save/re-use heigh requested by the user
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-brancotte authored May 18, 2021
1 parent f02584e commit 021487d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ window.onload = function() {
browser.current_branch(branch);
}
var treeElement = document.getElementById("tree-and-controls");
treeElement.style.height = localStorage.getItem("tree-and-controls-height");
var resizer = document.getElementById("handle");
resizer.addEventListener("mousedown", initDrag, false);
var startY, startHeight;
Expand All @@ -83,6 +84,7 @@ window.onload = function() {
function stopDrag(e) {
document.documentElement.removeEventListener("mousemove", doDrag, false);
document.documentElement.removeEventListener("mouseup", stopDrag, false);
localStorage.setItem("tree-and-controls-height", treeElement.style.height);
}
$("input[name='show-detail']").prop("checked" , (localStorage.getItem("show-detail")||"true") == "true");
$("input[name='show-community-usage']").prop("checked" , (localStorage.getItem("show-community-usage")||"false") == "true");
Expand Down

0 comments on commit 021487d

Please sign in to comment.