[DE PE SSE mobile] Fix Bug 54574

This commit is contained in:
SergeyEzhin 2021-12-17 13:54:54 +04:00
parent 9fa762146e
commit 58d0e413ae
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 storeToolbarSettings = props.storeToolbarSettings;
const isCanUndo = storeToolbarSettings.isCanUndo; const isCanUndo = storeToolbarSettings.isCanUndo;
const isCanRedo = storeToolbarSettings.isCanRedo; const isCanRedo = storeToolbarSettings.isCanRedo;
const disabledControls = storeToolbarSettings.disabledControls;
const disabledEditControls = storeToolbarSettings.disabledEditControls;
const disabledSettings = storeToolbarSettings.disabledSettings;
const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights; 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) => { const deactivateEditControls = (enableDownload) => {
setDisabledEditControls(true); storeToolbarSettings.setDisabledEditControls(true);
if (enableDownload) { if (enableDownload) {
//DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload}); //DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
} else { } else {
setDisabledSettings(true); storeToolbarSettings.setDisabledSettings(true);
} }
}; };
const [disabledControls, setDisabledControls] = useState(true);
const activateControls = () => { const activateControls = () => {
setDisabledControls(false); storeToolbarSettings.setDisabledControls(false);
}; };
const onEditDocument = () => { const onEditDocument = () => {

View file

@ -6,10 +6,34 @@ export class storeToolbarSettings {
isCanUndo: observable, isCanUndo: observable,
setCanUndo: action, setCanUndo: action,
isCanRedo: observable, 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; isCanUndo = false;
setCanUndo(can) { setCanUndo(can) {

View file

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

View file

@ -8,10 +8,34 @@ export class storeToolbarSettings {
isCanRedo: observable, isCanRedo: observable,
setCanRedo: action, setCanRedo: action,
countPages: observable, 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; isCanUndo = false;
setCanUndo(can) { setCanUndo(can) {

View file

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