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

View file

@ -39,7 +39,10 @@ export class storeWorksheets {
setProtectedWorkbook: action, setProtectedWorkbook: action,
wsProps: observable, wsProps: observable,
setWsProps: action setWsProps: action,
isDisabledEditSheet: observable,
setDisabledEditSheet: action
}); });
this.sheets = []; this.sheets = [];
} }
@ -110,4 +113,9 @@ export class storeWorksheets {
setWsLock(value) { setWsLock(value) {
this.wsLock = 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 isProtectedWorkbook = sheets.isProtectedWorkbook;
const isEdit = storeAppOptions.isEdit; const isEdit = storeAppOptions.isEdit;
const isDisconnected = users.isDisconnected; const isDisconnected = users.isDisconnected;
const isDisabledEditSheet = sheets.isDisabledEditSheet;
return ( return (
<Fragment> <Fragment>
<View id="idx-statusbar" className="statusbar" style={viewStyle}> <View id="idx-statusbar" className="statusbar" style={viewStyle}>
<div id="idx-box-add-tab" className={`${isDisconnected || isWorkbookLocked || isProtectedWorkbook ? 'disabled' : ''}`}> <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" /> <Icon className="icon icon-plus" />
</Link> </Link>
</div> </div>