Merge pull request #1269 from ONLYOFFICE/feature/bug-fixes

[SSE mobile] Fix Bug 53279
This commit is contained in:
maxkadushkin 2021-10-23 10:41:26 +03:00 committed by GitHub
commit 81bb2fd40d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View file

@ -22,6 +22,7 @@ const StatusbarController = inject('sheets', 'storeFocusObjects', 'users')(obser
api.asc_registerCallback('asc_onChangeProtectWorkbook', () => {
sheets.setProtectedWorkbook(api.asc_isProtectedWorkbook());
});
api.asc_registerCallback('asc_onEditCell', onApiEditCell);
api.asc_registerCallback('asc_onSheetsChanged', onApiSheetsChanged);
api.asc_registerCallback('asc_onActiveSheetChanged', onApiActiveSheetChanged);
api.asc_registerCallback('asc_onHidePopMenu', onApiHideTabContextMenu);
@ -32,6 +33,11 @@ const StatusbarController = inject('sheets', 'storeFocusObjects', 'users')(obser
Common.Notifications.on('api:disconnect', onApiDisconnect);
});
const onApiEditCell = state => {
let isDisable = state !== Asc.c_oAscCellEditorState.editEnd;
sheets.setDisabledEditSheet(isDisable);
}
const onApiDisconnect = () => {
users.resetDisconnected(true);
}
@ -127,6 +133,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props =>
const isEdit = storeAppOptions.isEdit;
const isDisconnected = users.isDisconnected;
const isProtectedWorkbook = sheets.isProtectedWorkbook;
const isDisabledEditSheet = sheets.isDisabledEditSheet;
useEffect(() => {
const on_main_view_click = e => {
@ -184,7 +191,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props =>
if (index == api.asc_getActiveWorksheetIndex()) {
if (!opened) {
if (isEdit && !isDisconnected && !model.locked && !isProtectedWorkbook) {
if (isEdit && !isDisconnected && !model.locked && !isProtectedWorkbook && !isDisabledEditSheet) {
api.asc_closeCellEditor();
f7.popover.open('#idx-tab-context-menu-popover', target);
}

View file

@ -39,7 +39,10 @@ export class storeWorksheets {
setProtectedWorkbook: action,
wsProps: observable,
setWsProps: action
setWsProps: action,
isDisabledEditSheet: observable,
setDisabledEditSheet: action
});
this.sheets = [];
}
@ -110,4 +113,9 @@ export class storeWorksheets {
setWsLock(value) {
this.wsLock = value;
}
isDisabledEditSheet;
setDisabledEditSheet(value) {
this.isDisabledEditSheet = value;
}
}

View file

@ -20,12 +20,13 @@ const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(prop
const isProtectedWorkbook = sheets.isProtectedWorkbook;
const isEdit = storeAppOptions.isEdit;
const isDisconnected = users.isDisconnected;
const isDisabledEditSheet = sheets.isDisabledEditSheet;
return (
<Fragment>
<View id="idx-statusbar" className="statusbar" style={viewStyle}>
<div id="idx-box-add-tab" className={`${isDisconnected || isWorkbookLocked || isProtectedWorkbook ? 'disabled' : ''}`}>
<Link href={false} id="idx-btn-addtab" className={`tab${isDisconnected || isWorkbookLocked || isProtectedWorkbook ? ' disabled' : ''}`} onClick={props.onAddTabClicked}>
<Link href={false} id="idx-btn-addtab" className={`tab${isDisabledEditSheet || isDisconnected || isWorkbookLocked || isProtectedWorkbook ? ' disabled' : ''}`} onClick={props.onAddTabClicked}>
<Icon className="icon icon-plus" />
</Link>
</div>