Merge pull request #1421 from ONLYOFFICE/feature/bug-hotfix

[DE PE SSE mobile] Fix Bug 54574
This commit is contained in:
maxkadushkin 2021-12-17 13:10:10 +03:00 committed by GitHub
commit a0112969ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 20 deletions

View file

@ -19,6 +19,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
const storeToolbarSettings = props.storeToolbarSettings;
const isCanUndo = storeToolbarSettings.isCanUndo;
const isCanRedo = storeToolbarSettings.isCanRedo;
const disabledControls = storeToolbarSettings.disabledControls;
const disabledEditControls = storeToolbarSettings.disabledEditControls;
const disabledSettings = storeToolbarSettings.disabledSettings;
const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights;
@ -104,20 +107,17 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
}
}
const [disabledEditControls, setDisabledEditControls] = useState(false);
const [disabledSettings, setDisabledSettings] = useState(false);
const deactivateEditControls = (enableDownload) => {
setDisabledEditControls(true);
storeToolbarSettings.setDisabledEditControls(true);
if (enableDownload) {
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
} else {
setDisabledSettings(true);
storeToolbarSettings.setDisabledSettings(true);
}
};
const [disabledControls, setDisabledControls] = useState(true);
const activateControls = () => {
setDisabledControls(false);
storeToolbarSettings.setDisabledControls(false);
};
const onEditDocument = () => {

View file

@ -6,10 +6,34 @@ export class storeToolbarSettings {
isCanUndo: observable,
setCanUndo: action,
isCanRedo: observable,
setCanRedo: action
setCanRedo: action,
disabledControls: observable,
setDisabledControls: action,
disabledEditControls: observable,
setDisabledEditControls: action,
disabledSettings: observable,
setDisabledSettings: action
})
}
disabledControls = true;
setDisabledControls(value) {
this.disabledControls = value;
}
disabledEditControls = false;
setDisabledEditControls(value) {
this.disabledEditControls = value;
}
disabledSettings = false;
setDisabledSettings(value) {
this.disabledSettings = value;
}
isCanUndo = false;
setCanUndo(can) {

View file

@ -20,6 +20,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
const isCanUndo = storeToolbarSettings.isCanUndo;
const isCanRedo = storeToolbarSettings.isCanRedo;
const disabledPreview = storeToolbarSettings.countPages <= 0;
const disabledControls = storeToolbarSettings.disabledControls;
const disabledEditControls = storeToolbarSettings.disabledEditControls;
const disabledSettings = storeToolbarSettings.disabledSettings;
const docInfo = props.storePresentationInfo;
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
@ -105,21 +108,17 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects'
}
}
const [disabledEditControls, setDisabledEditControls] = useState(false);
const [disabledSettings, setDisabledSettings] = useState(false);
const deactivateEditControls = (enableDownload) => {
setDisabledEditControls(true);
storeToolbarSettings.setDisabledEditControls(true);
if (enableDownload) {
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
} else {
setDisabledSettings(true);
storeToolbarSettings.setDisabledSettings(true);
}
};
const [disabledControls, setDisabledControls] = useState(/*true*/false);
const activateControls = () => {
setDisabledControls(false);
storeToolbarSettings.setDisabledControls(false);
};
const onEditDocument = () => {

View file

@ -8,10 +8,34 @@ export class storeToolbarSettings {
isCanRedo: observable,
setCanRedo: action,
countPages: observable,
setCountPages: action
setCountPages: action,
disabledControls: observable,
setDisabledControls: action,
disabledEditControls: observable,
setDisabledEditControls: action,
disabledSettings: observable,
setDisabledSettings: action
})
}
disabledControls = true;
setDisabledControls(value) {
this.disabledControls = value;
}
disabledEditControls = false;
setDisabledEditControls(value) {
this.disabledEditControls = value;
}
disabledSettings = false;
setDisabledSettings(value) {
this.disabledSettings = value;
}
isCanUndo = false;
setCanUndo(can) {

View file

@ -111,13 +111,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
}
}
// const [disabledEditControls, setDisabledEditControls] = useState(false);
const onApiActiveSheetChanged = (index) => {
Common.Notifications.trigger('comments:filterchange', ['doc', 'sheet' + Common.EditorApi.get().asc_getWorksheetId(index)], false );
};
// const [disabledSettings, setDisabledSettings] = useState(false);
const deactivateEditControls = (enableDownload) => {
storeToolbarSettings.setDisabledEditControls(true);
if (enableDownload) {
@ -127,9 +124,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
}
};
// const [disabledControls, setDisabledControls] = useState(/*true*/false);
const activateControls = () => {
// setDisabledControls(false);
storeToolbarSettings.setDisabledControls(false);
};