mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 10:59:28 +08:00
Merge pull request 'fix/pdf-form-mobile-view' (#135) from fix/pdf-form-mobile-view into hotfix/v8.2.2
This commit is contained in:
@ -347,7 +347,6 @@ class MainController extends Component {
|
||||
const isOForm = appOptions.isOForm;
|
||||
const appSettings = this.props.storeApplicationSettings;
|
||||
const customization = appOptions.customization;
|
||||
const isStandardView = customization?.mobile?.standardView ?? false;
|
||||
|
||||
f7.emit('resize');
|
||||
|
||||
@ -378,10 +377,10 @@ class MainController extends Component {
|
||||
appSettings.changeShowTableEmptyLine(value);
|
||||
this.api.put_ShowTableEmptyLine(value);
|
||||
|
||||
|
||||
value = LocalStorage.getBool('mobile-view');
|
||||
value = LocalStorage.itemExists('mobile-view') ?
|
||||
LocalStorage.getBool('mobile-view') : !(customization?.mobile?.standardView ?? false);
|
||||
|
||||
if(value || !isStandardView) {
|
||||
if(appOptions.isMobileViewAvailable && value) {
|
||||
this.api.ChangeReaderMode();
|
||||
} else {
|
||||
appOptions.changeMobileView();
|
||||
@ -466,7 +465,8 @@ class MainController extends Component {
|
||||
|
||||
Common.Utils.Metric.setCurrentMetric(1); //pt
|
||||
|
||||
this.appOptions = {isCorePDF: isPDF};
|
||||
this.appOptions = {isCorePDF: isPDF};
|
||||
this.props.storeAppOptions.isMobileViewAvailable = !this.appOptions.isCorePDF;
|
||||
this.bindEvents();
|
||||
|
||||
Common.Gateway.on('init', loadConfig);
|
||||
|
||||
@ -418,6 +418,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||
isViewer={isViewer}
|
||||
turnOnViewerMode={turnOnViewerMode}
|
||||
isMobileView={isMobileView}
|
||||
isMobileViewAvailable={appOptions.isMobileViewAvailable}
|
||||
changeMobileView={changeMobileView}
|
||||
changeTitleHandler={changeTitleHandler}
|
||||
isVersionHistoryMode={isVersionHistoryMode}
|
||||
|
||||
@ -65,6 +65,7 @@ export class storeAppOptions {
|
||||
this.typeProtection = type;
|
||||
}
|
||||
|
||||
isMobileViewAvailable = true;
|
||||
isMobileView = true;
|
||||
changeMobileView() {
|
||||
this.isMobileView = !this.isMobileView;
|
||||
|
||||
@ -62,7 +62,7 @@ const ToolbarView = props => {
|
||||
})
|
||||
}
|
||||
{!isEditableForms ? [
|
||||
((isViewer || !Device.phone) && isAvailableExt && !props.disabledControls && !isVersionHistoryMode) &&
|
||||
((isViewer || !Device.phone) && props.isMobileViewAvailable && !props.disabledControls && !isVersionHistoryMode) &&
|
||||
<Link key='toggle-view-link' className={isOpenModal ? 'disabled' : ''} icon={isMobileView ? 'icon-standard-view' : 'icon-mobile-view'} href={false} onClick={() => {
|
||||
props.changeMobileView();
|
||||
props.openOptions('snackbar');
|
||||
@ -96,6 +96,7 @@ const ToolbarView = props => {
|
||||
<Link key='btn-settings'
|
||||
className={(props.disabledSettings || props.disabledControls || isDisconnected || isOpenModal) && 'disabled'}
|
||||
icon='icon-settings' href={false}
|
||||
id='btn-settings'
|
||||
onClick={() => props.openOptions('settings')}></Link>,
|
||||
<Link key='send-form-link'
|
||||
id='btn-submit-form'
|
||||
|
||||
@ -126,7 +126,7 @@ const SettingsPage = inject("storeAppOptions", "storeReview", "storeDocumentInfo
|
||||
<Icon slot="media" icon="icon-spellcheck"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{((!isViewer && Device.phone) || isEditableForms) &&
|
||||
{(appOptions.isMobileViewAvailable && ((Device.phone && !isViewer) || isEditableForms)) &&
|
||||
<ListItem title={t('Settings.textMobileView')}>
|
||||
<Icon slot="media" icon="icon-mobile-view"></Icon>
|
||||
<Toggle checked={isMobileView} onToggleChange={() => {
|
||||
|
||||
Reference in New Issue
Block a user