[SSE] Fix Bug 53149
This commit is contained in:
parent
30fd37cd24
commit
a7a924ce28
|
@ -41,6 +41,7 @@
|
|||
},
|
||||
"ContextMenu": {
|
||||
"errorCopyCutPaste": "Copy, cut, and paste actions using the context menu will be performed within the current file only.",
|
||||
"errorInvalidLink": "The link reference does not exist. Please correct the link or delete it.",
|
||||
"menuAddComment": "Add Comment",
|
||||
"menuAddLink": "Add Link",
|
||||
"menuCancel": "Cancel",
|
||||
|
|
|
@ -26,6 +26,7 @@ class ContextMenu extends ContextMenuController {
|
|||
this.onApiShowComment = this.onApiShowComment.bind(this);
|
||||
this.onApiHideComment = this.onApiHideComment.bind(this);
|
||||
this.getUserName = this.getUserName.bind(this);
|
||||
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
|
||||
}
|
||||
|
||||
static closeContextMenu() {
|
||||
|
@ -43,6 +44,7 @@ class ContextMenu extends ContextMenuController {
|
|||
const api = Common.EditorApi.get();
|
||||
api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment);
|
||||
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
||||
api.asc_unregisterCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,6 +60,20 @@ class ContextMenu extends ContextMenuController {
|
|||
// super.onMenuClosed();
|
||||
// }
|
||||
|
||||
onApiHyperlinkClick(url) {
|
||||
const { t } = this.props;
|
||||
|
||||
if(!url) {
|
||||
f7.dialog.create({
|
||||
title: t('ContextMenu.notcriticalErrorTitle'),
|
||||
text: t('ContextMenu.errorInvalidLink'),
|
||||
buttons:[
|
||||
{text: 'OK'}
|
||||
]
|
||||
}).open();
|
||||
}
|
||||
}
|
||||
|
||||
onMenuItemClick(action) {
|
||||
const { t } = this.props;
|
||||
const _t = t("ContextMenu", { returnObjects: true });
|
||||
|
@ -175,6 +191,7 @@ class ContextMenu extends ContextMenuController {
|
|||
const api = Common.EditorApi.get();
|
||||
api.asc_registerCallback('asc_onShowComment', this.onApiShowComment);
|
||||
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
||||
api.asc_registerCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
||||
}
|
||||
|
||||
initMenuItems() {
|
||||
|
|
Loading…
Reference in a new issue