Skip to content
Permalink
Browse files

Clipper: Fixed sizing issue when importing HTML pages

  • Loading branch information...
laurent22 committed Jul 16, 2019
1 parent 7239a20 commit 30d0dfb42410c82fdbacc572d6eac98e0c7bd674
Showing with 13 additions and 7 deletions.
  1. +4 −1 ElectronClient/app/gui/note-viewer/index.html
  2. +9 −6 ReactNativeClient/lib/services/rest/Api.js
@@ -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,19 +572,22 @@ 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 };
resolve();
});
}

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()

0 comments on commit 30d0dfb

Please sign in to comment.
You can’t perform that action at this time.