mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
Clipper: Fixed sizing issue when importing HTML pages
This commit is contained in:
parent
7239a2013c
commit
30d0dfb424
@ -13,9 +13,11 @@
|
||||
/* Without this they would just stay at a fixed position when scrolling */
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
|
||||
/* Note: the height is set via updateBodyHeight(). Setting it here to 100% */
|
||||
/* won't work with some pages due to the position: relative */
|
||||
}
|
||||
|
||||
mark {
|
||||
@ -256,6 +258,7 @@
|
||||
// The body element needs to have a fixed height for the content to be scrollable
|
||||
function updateBodyHeight() {
|
||||
document.getElementById('body').style.height = window.innerHeight + 'px';
|
||||
document.getElementById('content').style.height = window.innerHeight + 'px';
|
||||
}
|
||||
|
||||
contentElement.addEventListener('scroll', webviewLib.logEnabledEventHandler(e => {
|
||||
|
@ -572,12 +572,7 @@ class Api {
|
||||
|
||||
const output = {};
|
||||
|
||||
let urlIndex = 0;
|
||||
const promiseProducer = () => {
|
||||
if (urlIndex >= urls.length) return null;
|
||||
|
||||
const url = urls[urlIndex++];
|
||||
|
||||
const downloadOne = url => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const imagePath = await this.downloadImage_(url, allowFileProtocolImages);
|
||||
if (imagePath) output[url] = { path: imagePath, originalUrl: url };
|
||||
@ -585,6 +580,14 @@ class Api {
|
||||
});
|
||||
}
|
||||
|
||||
let urlIndex = 0;
|
||||
const promiseProducer = () => {
|
||||
if (urlIndex >= urls.length) return null;
|
||||
|
||||
const url = urls[urlIndex++];
|
||||
return downloadOne(url);
|
||||
}
|
||||
|
||||
const concurrency = 10;
|
||||
const pool = new PromisePool(promiseProducer, concurrency)
|
||||
await pool.start()
|
||||
|
Loading…
Reference in New Issue
Block a user