[DE mobile] Fix Bug 58673

This commit is contained in:
SergeyEzhin 2022-08-24 17:59:49 +03:00
parent 158cd48e0b
commit f11da151d7
2 changed files with 6 additions and 2 deletions

View file

@ -29,6 +29,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights;
const docInfo = props.storeDocumentInfo;
const docExt = docInfo.dataDoc ? docInfo.dataDoc.fileType : '';
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
useEffect(() => {
@ -154,6 +155,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
closeOptions={props.closeOptions}
isEdit={appOptions.isEdit}
docTitle={docTitle}
docExt={docExt}
isShowBack={isShowBack}
onBack={onBack}
isCanUndo={isCanUndo}

View file

@ -7,6 +7,8 @@ import EditorUIController from '../lib/patch';
const ToolbarView = props => {
const { t } = useTranslation();
const isDisconnected = props.isDisconnected;
const docExt = props.docExt;
const isAvailableExt = docExt && docExt !== 'djvu' && docExt !== 'pdf' && docExt !== 'xps';
const disableEditBtn = props.isObjectLocked || props.stateDisplayMode || props.disabledEditControls || isDisconnected;
const isViewer = props.isViewer;
const isMobileView = props.isMobileView;
@ -54,12 +56,12 @@ const ToolbarView = props => {
{(props.showEditDocument && !isViewer) &&
<Link className={props.disabledControls ? 'disabled' : ''} icon='icon-edit' href={false} onClick={props.onEditDocument}></Link>
}
{props.isEdit && !isViewer && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
{props.isEdit && isAvailableExt && !isViewer && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
disabled: disableEditBtn || props.disabledControls,
onEditClick: e => props.openOptions('edit'),
onAddClick: e => props.openOptions('add')
})}
{isViewer && <Link icon='icon-edit-mode' className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} href={false} onClick={() => props.turnOffViewerMode()}></Link>}
{isViewer && isAvailableExt && <Link icon='icon-edit-mode' className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} href={false} onClick={() => props.turnOffViewerMode()}></Link>}
{Device.phone ? null : <Link className={(props.disabledControls || props.readerMode) && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link>}
{props.displayCollaboration && window.matchMedia("(min-width: 360px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={e => props.openOptions('coauth')}></Link> : null}
<Link className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={e => props.openOptions('settings')}></Link>