scrolling fixes
This commit is contained in:
@@ -98,12 +98,12 @@ FileManager.prototype.renderVisibleFiles = function(files, freshStart) {
|
|||||||
let scrollDown = this.lastScrollTop <= this.directoryArea.scrollTop;
|
let scrollDown = this.lastScrollTop <= this.directoryArea.scrollTop;
|
||||||
this.lastScrollTop = this.directoryArea.scrollTop;
|
this.lastScrollTop = this.directoryArea.scrollTop;
|
||||||
|
|
||||||
let fileHeight = 28;
|
let fileHeight = 32;
|
||||||
let totalHeight = (files.length * fileHeight)+16;
|
let totalHeight = (files.length * fileHeight)+38;
|
||||||
let viewportHeight = this.directoryArea.clientHeight+100;
|
let viewportHeight = this.directoryArea.clientHeight;
|
||||||
let paddingTop = this.directoryArea.scrollTop-100;
|
let paddingTop = this.lastScrollTop - this.lastScrollTop%fileHeight;
|
||||||
if (paddingTop < 0) { paddingTop = 0;}
|
if (paddingTop < 0) { paddingTop = 0;}
|
||||||
let paddingBottom = totalHeight - paddingTop - viewportHeight;
|
let paddingBottom = totalHeight - paddingTop - viewportHeight - this.lastScrollTop%fileHeight;
|
||||||
if (paddingBottom < 0) {paddingBottom = 0;}
|
if (paddingBottom < 0) {paddingBottom = 0;}
|
||||||
|
|
||||||
// Pad the items out which we're not going to show
|
// Pad the items out which we're not going to show
|
||||||
@@ -126,8 +126,6 @@ FileManager.prototype.renderVisibleFiles = function(files, freshStart) {
|
|||||||
lastEl = this.dirContainer.lastElementChild;
|
lastEl = this.dirContainer.lastElementChild;
|
||||||
lastIdx = Number.parseInt(lastEl.getAttribute("fileindex"));
|
lastIdx = Number.parseInt(lastEl.getAttribute("fileindex"));
|
||||||
|
|
||||||
this.dirContainer.insert
|
|
||||||
|
|
||||||
if (firstIdx < start) {
|
if (firstIdx < start) {
|
||||||
this.dirContainer.removeChild(firstEl);
|
this.dirContainer.removeChild(firstEl);
|
||||||
console.debug("Remove start "+firstIdx);
|
console.debug("Remove start "+firstIdx);
|
||||||
@@ -141,7 +139,6 @@ FileManager.prototype.renderVisibleFiles = function(files, freshStart) {
|
|||||||
|
|
||||||
console.debug("Start "+start+" end "+end+" first el "+firstIdx+" last el "+lastIdx);
|
console.debug("Start "+start+" end "+end+" first el "+firstIdx+" last el "+lastIdx);
|
||||||
|
|
||||||
|
|
||||||
let makeButton = (i, file) => {
|
let makeButton = (i, file) => {
|
||||||
let el = document.createElement("a");
|
let el = document.createElement("a");
|
||||||
el.classList = "node";
|
el.classList = "node";
|
||||||
|
@@ -39,8 +39,7 @@
|
|||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
/* padding: 0; */
|
padding: 0;
|
||||||
padding: 8px;
|
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -55,8 +54,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-top: 4px;
|
margin: 8px;
|
||||||
margin-bottom: 4px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--text_color);
|
color: var(--text_color);
|
||||||
|
Reference in New Issue
Block a user