diff --git a/src/index.html b/src/index.html index 4d94d29df..aae9877b7 100644 --- a/src/index.html +++ b/src/index.html @@ -57,6 +57,10 @@ + +
+ +
@@ -77,9 +81,6 @@ // Cache it in local storage localStorage.setItem(selector, value) - - // Attempt to load Preview - loadPreview(); } function loadPreview(options) { @@ -102,6 +103,7 @@ // Try to load all properties from storage on page load setProperty('token'); setProperty('fileid'); + loadPreview(); diff --git a/src/lib/VirtualScroller.js b/src/lib/VirtualScroller.js index 60a67b013..117549030 100644 --- a/src/lib/VirtualScroller.js +++ b/src/lib/VirtualScroller.js @@ -250,7 +250,7 @@ class VirtualScroller { // If specified offset is in the last window into the list then // render that last window instead of starting at that offset - const lastWindowOffset = this.totalItems - this.maxRenderedItems; + const lastWindowOffset = Math.max(0, this.totalItems - this.maxRenderedItems); let newStartOffset = offset > lastWindowOffset ? lastWindowOffset : offset; let newEndOffset = offset + this.maxRenderedItems; // If the default count of items to render exceeds the totalItems count diff --git a/src/lib/shell.html b/src/lib/shell.html index ea11e09a4..7f0d58abc 100644 --- a/src/lib/shell.html +++ b/src/lib/shell.html @@ -50,7 +50,7 @@ -
+