mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
bug fixes
This commit is contained in:
parent
4579fb25c6
commit
3d7a6374ad
@ -213,6 +213,7 @@ _html2canvas.Util.Children = function(el) {
|
|||||||
var children;
|
var children;
|
||||||
try {
|
try {
|
||||||
children = $(el).contents();
|
children = $(el).contents();
|
||||||
|
// children = (el.nodeName && el.nodeName.toUpperCase() === "IFRAME") ? el.contentDocument || el.contentWindow.document : Array.prototype.push.call([], el.childNodes );
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
h2clog("html2canvas.Util.Children failed with exception: " + ex.message);
|
h2clog("html2canvas.Util.Children failed with exception: " + ex.message);
|
||||||
children = [];
|
children = [];
|
||||||
|
@ -213,12 +213,13 @@ _html2canvas.Preload = function( options ) {
|
|||||||
// TODO Opera has no load/error event for SVG images
|
// TODO Opera has no load/error event for SVG images
|
||||||
|
|
||||||
// Opera ninja onload's cached images
|
// Opera ninja onload's cached images
|
||||||
|
/*
|
||||||
window.setTimeout(function(){
|
window.setTimeout(function(){
|
||||||
if ( img.width !== 0 && imageObj.succeeded === undefined ) {
|
if ( img.width !== 0 && imageObj.succeeded === undefined ) {
|
||||||
img.onload();
|
img.onload();
|
||||||
}
|
}
|
||||||
}, 100); // needs a reflow for base64 encoded images? interestingly timeout of 0 doesn't work but 1 does.
|
}, 100); // needs a reflow for base64 encoded images? interestingly timeout of 0 doesn't work but 1 does.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ _html2canvas.Renderer = function(parseQueue, options){
|
|||||||
|
|
||||||
sortZ(parseQueue.zIndex);
|
sortZ(parseQueue.zIndex);
|
||||||
if ( typeof options.renderer._create !== "function" ) {
|
if ( typeof options.renderer._create !== "function" ) {
|
||||||
throw Error("Invalid renderer defined");
|
throw new Error("Invalid renderer defined");
|
||||||
}
|
}
|
||||||
return options.renderer._create( parseQueue, options, document, queue, _html2canvas );
|
return options.renderer._create( parseQueue, options, document, queue, _html2canvas );
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ html2canvas.Renderer.Canvas = function( options ) {
|
|||||||
|
|
||||||
return canvas;
|
return canvas;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
return methods;
|
return methods;
|
||||||
|
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
<head>
|
<head>
|
||||||
<script type="text/javascript" src="test.js"></script>
|
<script type="text/javascript" src="test.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
function setUp(){
|
||||||
h2cSelector = '#bar';
|
h2cSelector = '#bar';
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<title>
|
<title>
|
||||||
display/box/float/clear test
|
display/box/float/clear test
|
||||||
|
@ -14,10 +14,12 @@ var h2cSelector, h2cOptions;
|
|||||||
document.write(scrStart + '../src/' + html2canvas[i] + '.js' + scrEnd);
|
document.write(scrStart + '../src/' + html2canvas[i] + '.js' + scrEnd);
|
||||||
}
|
}
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
h2cSelector = [document.body];
|
||||||
|
|
||||||
if (window.setUp) {
|
if (window.setUp) {
|
||||||
window.setUp();
|
window.setUp();
|
||||||
}
|
}
|
||||||
h2cSelector = [document.body];
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
||||||
$(h2cSelector).html2canvas($.extend({
|
$(h2cSelector).html2canvas($.extend({
|
||||||
|
Loading…
Reference in New Issue
Block a user