You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Clipper: Fixed sizing issue when importing HTML pages
This commit is contained in:
		| @@ -13,9 +13,11 @@ | |||||||
| 			/* Without this they would just stay at a fixed position when scrolling */ | 			/* Without this they would just stay at a fixed position when scrolling */ | ||||||
| 			position: relative; | 			position: relative; | ||||||
| 			overflow-y: auto; | 			overflow-y: auto; | ||||||
| 			height: 100%; |  | ||||||
| 			padding-left: 10px; | 			padding-left: 10px; | ||||||
| 			padding-right: 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 { | 		mark { | ||||||
| @@ -256,6 +258,7 @@ | |||||||
| 		// The body element needs to have a fixed height for the content to be scrollable | 		// The body element needs to have a fixed height for the content to be scrollable | ||||||
| 		function updateBodyHeight() { | 		function updateBodyHeight() { | ||||||
| 			document.getElementById('body').style.height = window.innerHeight + 'px'; | 			document.getElementById('body').style.height = window.innerHeight + 'px'; | ||||||
|  | 			document.getElementById('content').style.height = window.innerHeight + 'px'; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		contentElement.addEventListener('scroll', webviewLib.logEnabledEventHandler(e => { | 		contentElement.addEventListener('scroll', webviewLib.logEnabledEventHandler(e => { | ||||||
|   | |||||||
| @@ -572,12 +572,7 @@ class Api { | |||||||
|  |  | ||||||
| 		const output = {}; | 		const output = {}; | ||||||
|  |  | ||||||
| 		let urlIndex = 0; | 		const downloadOne = url => { | ||||||
| 		const promiseProducer = () => { |  | ||||||
| 			if (urlIndex >= urls.length) return null; |  | ||||||
|  |  | ||||||
| 			const url = urls[urlIndex++]; |  | ||||||
|  |  | ||||||
| 			return new Promise(async (resolve, reject) => { | 			return new Promise(async (resolve, reject) => { | ||||||
| 				const imagePath = await this.downloadImage_(url, allowFileProtocolImages); | 				const imagePath = await this.downloadImage_(url, allowFileProtocolImages); | ||||||
| 				if (imagePath) output[url] = { path: imagePath, originalUrl: url }; | 				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 concurrency = 10; | ||||||
| 		const pool = new PromisePool(promiseProducer, concurrency) | 		const pool = new PromisePool(promiseProducer, concurrency) | ||||||
| 		await pool.start() | 		await pool.start() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user