Skip to content

Commit 033a58c

Browse files
authored
feat: scroll to bottom (#28)
1 parent 41b9349 commit 033a58c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

import-bulk.html

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ <h2>Import - Bulk</h2>
5656
<sp-checkbox class="option-field" id="import-show-preview" checked>
5757
Show preview
5858
</sp-checkbox>
59+
60+
<sp-checkbox class="option-field" id="import-scroll-to-bottom" checked>
61+
Scroll to bottom
62+
</sp-checkbox>
5963
</div>
6064
</sp-accordion-item>
6165
</sp-accordion>

import.html

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ <h2>Import - Workbench</h2>
6060
<sp-checkbox class="option-field" id="import-enable-js" checked>
6161
Enable JavaScript
6262
</sp-checkbox>
63+
64+
<sp-checkbox class="option-field" id="import-scroll-to-bottom" checked>
65+
Scroll to bottom
66+
</sp-checkbox>
6367
</div>
6468
</sp-accordion-item>
6569
</sp-accordion>

js/import/import.ui.js

+4
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ const attachListeners = () => {
292292
const onLoad = async () => {
293293
const includeDocx = !!dirHandle;
294294

295+
if (config.fields['import-scroll-to-bottom']) {
296+
frame.contentWindow.window.scrollTo({ left: 0, top: frame.contentDocument.body.scrollHeight, behavior: "smooth" });
297+
}
298+
295299
window.setTimeout(async () => {
296300
const { originalURL, replacedURL } = frame.dataset;
297301
if (frame.contentDocument) {

0 commit comments

Comments
 (0)