[SSE] Fix Bug 53149
This commit is contained in:
parent
30fd37cd24
commit
a7a924ce28
|
@ -41,6 +41,7 @@
|
||||||
},
|
},
|
||||||
"ContextMenu": {
|
"ContextMenu": {
|
||||||
"errorCopyCutPaste": "Copy, cut, and paste actions using the context menu will be performed within the current file only.",
|
"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",
|
"menuAddComment": "Add Comment",
|
||||||
"menuAddLink": "Add Link",
|
"menuAddLink": "Add Link",
|
||||||
"menuCancel": "Cancel",
|
"menuCancel": "Cancel",
|
||||||
|
|
|
@ -26,6 +26,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.onApiShowComment = this.onApiShowComment.bind(this);
|
this.onApiShowComment = this.onApiShowComment.bind(this);
|
||||||
this.onApiHideComment = this.onApiHideComment.bind(this);
|
this.onApiHideComment = this.onApiHideComment.bind(this);
|
||||||
this.getUserName = this.getUserName.bind(this);
|
this.getUserName = this.getUserName.bind(this);
|
||||||
|
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static closeContextMenu() {
|
static closeContextMenu() {
|
||||||
|
@ -43,6 +44,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment);
|
api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment);
|
||||||
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
||||||
|
api.asc_unregisterCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,6 +60,20 @@ class ContextMenu extends ContextMenuController {
|
||||||
// super.onMenuClosed();
|
// 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) {
|
onMenuItemClick(action) {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const _t = t("ContextMenu", { returnObjects: true });
|
const _t = t("ContextMenu", { returnObjects: true });
|
||||||
|
@ -175,6 +191,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
api.asc_registerCallback('asc_onShowComment', this.onApiShowComment);
|
api.asc_registerCallback('asc_onShowComment', this.onApiShowComment);
|
||||||
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
||||||
|
api.asc_registerCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
initMenuItems() {
|
initMenuItems() {
|
||||||
|
|
Loading…
Reference in a new issue