From 13e636d81444ea86acc67ce9e9c31e87d572d003 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Jun 2017 13:10:00 +0300 Subject: [PATCH] [DE mobile] Disable reader mode for pdf/djvu/xps files. --- apps/documenteditor/mobile/app/controller/Main.js | 1 + apps/documenteditor/mobile/app/view/Settings.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index de92c9987..c8509804e 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -611,6 +611,7 @@ define([ var type = /^(?:(pdf|djvu|xps))$/.exec(me.document.fileType); me.appOptions.canDownloadOrigin = me.permissions.download !== false && (type && typeof type[1] === 'string'); me.appOptions.canDownload = me.permissions.download !== false && (!type || typeof type[1] !== 'string'); + me.appOptions.canReader = (!type || typeof type[1] !== 'string'); me._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && me.appOptions.canEdit && me.editorConfig.mode !== 'view'; diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 085a7138f..360087791 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -52,7 +52,8 @@ define([ // private var _isEdit = false, _canEdit = false, - _canDownload = false; + _canDownload = false, + _canReader = false; return { // el: '.view-main', @@ -91,6 +92,7 @@ define([ _isEdit = mode.isEdit; _canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; _canDownload = mode.canDownload || mode.canDownloadOrigin; + _canReader = !mode.isEdit && mode.canReader; }, rootLayout: function () { @@ -100,11 +102,14 @@ define([ if (_isEdit) { $layour.find('#settings-edit-document').hide(); - $layour.find('#settings-readermode').hide(); $layour.find('#settings-search .item-title').text(this.textFindAndReplace) } else { if (!_canEdit) $layour.find('#settings-edit-document').hide(); $layour.find('#settings-document').hide(); + } + if (!_canReader) + $layour.find('#settings-readermode').hide(); + else { $layour.find('#settings-readermode input:checkbox') .prop('checked', Common.SharedSettings.get('readerMode')); }