mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fixed non-required images being fetched.
Earlier all the images in <body> were being fetched which caused a bug when generating a canvas multiple times on the same element. Now only images inside the container element are fetched.
This commit is contained in:
parent
81ae37cbd1
commit
7fedf9ffe1
@ -20,8 +20,8 @@ _html2canvas.Preload = function( options ) {
|
||||
count = 0,
|
||||
element = options.elements[0] || document.body,
|
||||
doc = element.ownerDocument,
|
||||
domImages = doc.images, // TODO probably should limit it to images present in the element only
|
||||
imgLen = domImages.length,
|
||||
domImages = $(element).find('img'), // Find the images only inside the contained element
|
||||
imgLen = domImages.length || 0, //just it case
|
||||
link = doc.createElement("a"),
|
||||
supportCORS = (function( img ){
|
||||
return (img.crossOrigin !== undefined);
|
||||
|
Loading…
Reference in New Issue
Block a user