Commit 7a043df3 authored by Julia Radzhabova's avatar Julia Radzhabova

[DE mobile] Disable reader mode for pdf/djvu/xps files.

parent 46456fea
......@@ -613,6 +613,7 @@ define([
var type = /^(?:(pdf|djvu|xps))$/.exec(me.document.fileType);
me.appOptions.canDownloadOrigin = !me.appOptions.nativeApp && me.permissions.download !== false && (type && typeof type[1] === 'string');
me.appOptions.canDownload = !me.appOptions.nativeApp && 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';
......
......@@ -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'));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment