[SSE mobile] Fix open worksheet range link in context menu

This commit is contained in:
JuliaSvinareva 2021-03-29 20:00:55 +03:00
parent 5f82245fd2
commit 0824d2388d

View file

@ -12,7 +12,8 @@ import { Device } from '../../../../common/mobile/utils/device';
isEdit: stores.storeAppOptions.isEdit, isEdit: stores.storeAppOptions.isEdit,
canViewComments: stores.storeAppOptions.canViewComments, canViewComments: stores.storeAppOptions.canViewComments,
users: stores.users, users: stores.users,
isDisconnected: stores.users.isDisconnected isDisconnected: stores.users.isDisconnected,
storeSheets: stores.sheets
})) }))
class ContextMenu extends ContextMenuController { class ContextMenu extends ContextMenuController {
constructor(props) { constructor(props) {
@ -129,7 +130,16 @@ class ContextMenu extends ContextMenuController {
const nameSheet = linkinfo.asc_getSheet(); const nameSheet = linkinfo.asc_getSheet();
const curActiveSheet = api.asc_getActiveWorksheetIndex(); const curActiveSheet = api.asc_getActiveWorksheetIndex();
api.asc_setWorksheetRange(linkinfo); api.asc_setWorksheetRange(linkinfo);
//SSE.getController('Statusbar').onLinkWorksheetRange(nameSheet, curActiveSheet); const {storeSheets} = this.props;
const tab = storeSheets.sheets.find((sheet) => sheet.name === nameSheet);
if (tab) {
const sdkIndex = tab.index;
if (sdkIndex !== curActiveSheet) {
const index = storeSheets.sheets.indexOf(tab);
storeSheets.setActiveWorksheet(index);
Common.Notifications.trigger('sheet:active', sdkIndex);
}
}
} else { } else {
const url = linkinfo.asc_getHyperlinkUrl().replace(/\s/g, "%20"); const url = linkinfo.asc_getHyperlinkUrl().replace(/\s/g, "%20");
api.asc_getUrlType(url) > 0 && this.openLink(url); api.asc_getUrlType(url) > 0 && this.openLink(url);