Skip to content

Commit

Permalink
Merge branch 'bug/13_use_onclone_callback' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
therter committed Oct 9, 2019
2 parents 1e44a7d + b403e2d commit db97145
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions js/csis_include_in_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,23 @@ var groupContentTemplate = {
// the css property translate cannot be handled properly by html2canvas, if negative values are used and that is the case, if overlay layers are used.
// So replace the translate3d property with the top and left property. It was assumed that the third argument of translate3d is 0px
elementToPrint = elementToPrint.getElementById('#map');
replaceTranslate3dStyle(elementToPrint);
} else if (iframeFound) {
if (elementToPrint.body.getElementsByClassName('container ng-scope')[0] != null) {
elementToPrint = elementToPrint.body.getElementsByClassName('container ng-scope')[0];
isScenarioInChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
} else {
elementToPrint = elementToPrint.getElementById('root');
replaceTranslate3dStyle(elementToPrint);
}
} else if (elementToPrint.getElementsByClassName('leaflet-tile') != null && elementToPrint.getElementsByClassName('leaflet-tile').length > 0) {
replaceTranslate3dStyle(elementToPrint);
}

html2canvas(elementToPrint, { useCORS: true, allowTaint: false, async: false, logging: false, foreignObjectRendering: isScenarioInChrome }).then(canvas => {
html2canvas(elementToPrint, { useCORS: true,
allowTaint: false,
async: false,
logging: false,
foreignObjectRendering: isScenarioInChrome,
onclone: function(doc) {
replaceTranslate3dStyle(doc);
} }).then(canvas => {
canvas.toBlob(function (blob) {
getCsrfToken(function (csrfToken) {
postScreenshotFile(csrfToken, stepUUID, blob, imageName, btnElement);
Expand Down

0 comments on commit db97145

Please sign in to comment.