MarkP
May 15, 2023, 1:37pm
1
Product: WebViewer
Product Version: 8.3.2
Please give a brief summary of your issue:
Running original functionality when an event is overridden.
Please describe your issue and provide steps to reproduce it:
When I override an event such as in the following code
instance.UI.updateElement('thumbDelete', {
onClick: () => {
}
});
Is there a way to call the original functionality of the onClick event inside the override, such as inside an if
statement?
Ahmad
May 16, 2023, 9:53pm
2
Hi Mark,
Unfortunately, this is not possible with the current APIs.
You can achieve this for now by copying the original functionality of the button from the UI source code.
Here is the relevant file for this button:
core.removePages(pageNumbers).then(() => {
dispatch(actions.setSelectedPageThumbnails([]));
});
});
},
};
dispatch(actions.showWarningMessage(warning));
};
const deletePages = (pageNumbers, dispatch, isModalEnabled = true) => {
if (isModalEnabled) {
let message = i18next.t('warning.deletePage.deleteMessage');
const title = i18next.t('warning.deletePage.deleteTitle');
const confirmBtnText = i18next.t('action.ok');
let warning = {
message,
title,
confirmBtnText,
onConfirm: () => core.removePages(pageNumbers).then(() => {
Here is the publically exposed API for making a warning message the same as that function:
https://docs.apryse.com/api/web/UI.html#.showWarningMessage
Alternatively, I can create a feature request for our product team to review if you want.
Best Regards,
Ahmad Moaaz
Software Developer
Apryse