crabbly / crabbly/Print.js

onPrintDialogClose - cancel or print button clicked?

Open
#617 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.5k
Forks
688
PR merge metrics
No merged PRs in 30d

Description

The onPrintDialogClose event works well, but I could not find a way to determine if the user clicked the "Print" or "Cancel" button. Can you please add the actual button clicked as parameter in the callback function?

Example:
printJS({
printable: data.report,
type: 'pdf',
base64: true,
onPrintDialogClose: function (e) {
if (e === true) {
alert('Printing done - Print clicked');
} else {
alert('Cancel button clicked');
}
}
});

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.