Skip to content

Commit 7a287c6

Browse files
committed
#9 consider the bottom property during the transition handling
1 parent 9431c18 commit 7a287c6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

js/csis_include_in_report.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ var groupContentTemplate = {
150150
elementToPrint = elementToPrint.getElementById('indicatorCriteriaTable');
151151
isScenarioInChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
152152
imageScale = 1;
153+
imageName = 'table-snapshot.jpg';
153154
replaceImgSourceWithBase64Encoding(elementToPrint, imagesToRecover);
154155
} else if (event.currentTarget.id == 'includeChartButton') {
155156
//print the chart of the scenario analysis tool
156157
elementToPrint = elementToPrint.getElementById('indicator-bar-charts').firstChild;
157158
isScenarioInChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
159+
imageName = 'charts-snapshot.jpg';
158160
imageScale = 1;
159161
replaceImgSourceWithBase64Encoding(elementToPrint, imagesToRecover);
160162
} else if (iframeFound && elementToPrint.getElementById('#map') != null) {
@@ -279,11 +281,17 @@ function replaceTranslate3dStyleByElement(element) {
279281
}
280282

281283
if (
284+
element.style['bottom'] != null &&
285+
element.style['bottom'] != '' &&
286+
element.style['bottom'].indexOf('px') != -1
287+
) {
288+
element.style['bottom'] = parseInt(element.style['bottom'].replace(/px/g, '')) - trans_y + 'px';
289+
} else if (
282290
element.style['top'] != null &&
283291
element.style['top'] != '' &&
284292
element.style['top'].indexOf('px') != -1
285293
) {
286-
element.style['top'] = parseInt(element.style['top'].replace(/px/g, '')) + trans_x + 'px';
294+
element.style['top'] = parseInt(element.style['top'].replace(/px/g, '')) + trans_y + 'px';
287295
} else {
288296
element.style['top'] = trans_y + 'px';
289297
}

0 commit comments

Comments
 (0)