diff --git a/res/include/script/file_manager/FileManager.js b/res/include/script/file_manager/FileManager.js index 344dc8f..7154ac6 100644 --- a/res/include/script/file_manager/FileManager.js +++ b/res/include/script/file_manager/FileManager.js @@ -98,12 +98,12 @@ FileManager.prototype.renderVisibleFiles = function(files, freshStart) { let scrollDown = this.lastScrollTop <= this.directoryArea.scrollTop; this.lastScrollTop = this.directoryArea.scrollTop; - let fileHeight = 28; - let totalHeight = (files.length * fileHeight)+16; - let viewportHeight = this.directoryArea.clientHeight+100; - let paddingTop = this.directoryArea.scrollTop-100; + let fileHeight = 32; + let totalHeight = (files.length * fileHeight)+38; + let viewportHeight = this.directoryArea.clientHeight; + let paddingTop = this.lastScrollTop - this.lastScrollTop%fileHeight; if (paddingTop < 0) { paddingTop = 0;} - let paddingBottom = totalHeight - paddingTop - viewportHeight; + let paddingBottom = totalHeight - paddingTop - viewportHeight - this.lastScrollTop%fileHeight; if (paddingBottom < 0) {paddingBottom = 0;} // 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; lastIdx = Number.parseInt(lastEl.getAttribute("fileindex")); - this.dirContainer.insert - if (firstIdx < start) { this.dirContainer.removeChild(firstEl); 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); - let makeButton = (i, file) => { let el = document.createElement("a"); el.classList = "node"; diff --git a/res/template/account/file_manager.html b/res/template/account/file_manager.html index ecdbd27..06590d4 100644 --- a/res/template/account/file_manager.html +++ b/res/template/account/file_manager.html @@ -39,8 +39,7 @@ flex-shrink: 1; flex-grow: 1; margin: 0; - /* padding: 0; */ - padding: 8px; + padding: 0; overflow-x: hidden; overflow-y: scroll; text-align: left; @@ -55,8 +54,7 @@ position: relative; height: 24px; overflow: hidden; - margin-top: 4px; - margin-bottom: 4px; + margin: 8px; box-sizing: border-box; display: block; color: var(--text_color);