@worktile/gantt 19.0.8-next.4 → 19.0.8-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3171,7 +3171,7 @@ class GanttPrintService {
|
|
|
3171
3171
|
this.root = root.nativeElement;
|
|
3172
3172
|
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
3173
3173
|
}
|
|
3174
|
-
async
|
|
3174
|
+
async html2canvas(ignoreElementClass) {
|
|
3175
3175
|
const root = this.root;
|
|
3176
3176
|
const mainContainer = this.mainContainer;
|
|
3177
3177
|
// set print width
|
|
@@ -3179,7 +3179,7 @@ class GanttPrintService {
|
|
|
3179
3179
|
// set print height
|
|
3180
3180
|
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
3181
3181
|
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
3182
|
-
html2canvas(root, {
|
|
3182
|
+
return html2canvas(root, {
|
|
3183
3183
|
logging: false,
|
|
3184
3184
|
allowTaint: true,
|
|
3185
3185
|
useCORS: true,
|
|
@@ -3213,7 +3213,10 @@ class GanttPrintService {
|
|
|
3213
3213
|
// setInlineStyles for svg
|
|
3214
3214
|
this.setInlineStyles(cloneGanttDom);
|
|
3215
3215
|
}
|
|
3216
|
-
})
|
|
3216
|
+
});
|
|
3217
|
+
}
|
|
3218
|
+
async print(name = 'download', ignoreElementClass) {
|
|
3219
|
+
this.html2canvas(ignoreElementClass).then((canvas) => {
|
|
3217
3220
|
const link = document.createElement('a');
|
|
3218
3221
|
const dataUrl = canvas.toDataURL('image/png');
|
|
3219
3222
|
link.download = `${name}.png`;
|