Skip to content

Commit

Permalink
Merge pull request 'fix/pdf-form-mobile-view' (#135) from fix/pdf-for…
Browse files Browse the repository at this point in the history
…m-mobile-view into hotfix/v8.2.2
  • Loading branch information
maxkadushkin committed Nov 22, 2024
2 parents a6ddef9 + 475ef96 commit c4fa817
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
10 changes: 5 additions & 5 deletions apps/documenteditor/mobile/src/controller/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions apps/documenteditor/mobile/src/controller/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions apps/documenteditor/mobile/src/store/appOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class storeAppOptions {
this.typeProtection = type;
}

isMobileViewAvailable = true;
isMobileView = true;
changeMobileView() {
this.isMobileView = !this.isMobileView;
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/mobile/src/view/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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={() => {
Expand Down

0 comments on commit c4fa817

Please sign in to comment.