[Mobile] Fix Bug 47689

This commit is contained in:
Julia Radzhabova 2020-11-26 17:32:14 +03:00
parent 2d2a47aa2d
commit f65b9bc254
7 changed files with 89 additions and 54 deletions

View file

@ -143,13 +143,17 @@ define([
setMode: function (mode) { setMode: function (mode) {
this.getView('Settings').setMode(mode); this.getView('Settings').setMode(mode);
if (mode.canBranding) if (mode.isDisconnected) {
_licInfo = mode.customization; _canReview = _isReviewOnly = _isEdit = false;
_canReview = mode.canReview; } else {
_isReviewOnly = mode.isReviewOnly; if (mode.canBranding)
_fileKey = mode.fileKey; _licInfo = mode.customization;
_isEdit = mode.isEdit; _canReview = mode.canReview;
_lang = mode.lang; _isReviewOnly = mode.isReviewOnly;
_fileKey = mode.fileKey;
_isEdit = mode.isEdit;
_lang = mode.lang;
}
}, },
initEvents: function () { initEvents: function () {

View file

@ -181,13 +181,17 @@ define([
$('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled'); $('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
}, },
deactivateEditControls: function() { deactivateEditControls: function(enableDownload) {
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled'); $('#toolbar-edit, #toolbar-add').addClass('disabled');
if (enableDownload)
DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
else
$('#toolbar-settings').addClass('disabled');
}, },
onCoAuthoringDisconnect: function() { onCoAuthoringDisconnect: function(enableDownload) {
this.isDisconnected = true; this.isDisconnected = true;
this.deactivateEditControls(); this.deactivateEditControls(enableDownload);
$('#toolbar-undo').toggleClass('disabled', true); $('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true); $('#toolbar-redo').toggleClass('disabled', true);
DE.getController('AddContainer').hideModal(); DE.getController('AddContainer').hideModal();

View file

@ -106,22 +106,29 @@ define([
}, },
setMode: function (mode) { setMode: function (mode) {
_isEdit = mode.isEdit; if (mode.isDisconnected) {
_canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; _canEdit = _isEdit = false;
_canDownload = mode.canDownload; _canReview = false;
_canDownloadOrigin = mode.canDownloadOrigin; _isReviewOnly = false;
_canReader = !mode.isEdit && !mode.isRestrictedEdit && mode.canReader; if (!mode.enableDownload)
_canPrint = mode.canPrint; _canPrint = _canDownload = _canDownloadOrigin = false;
_canReview = mode.canReview; } else {
_isReviewOnly = mode.isReviewOnly; _isEdit = mode.isEdit;
_canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
_canReader = !mode.isEdit && !mode.isRestrictedEdit && mode.canReader;
_canReview = mode.canReview;
_isReviewOnly = mode.isReviewOnly;
_canDownload = mode.canDownload;
_canDownloadOrigin = mode.canDownloadOrigin;
_canPrint = mode.canPrint;
if (mode.customization && mode.canBrandingExt) {
_canAbout = (mode.customization.about!==false);
}
if (mode.customization && mode.canBrandingExt) { if (mode.customization) {
_canAbout = (mode.customization.about!==false); _canHelp = (mode.customization.help!==false);
} _isShowMacros = (mode.customization.macros!==false);
}
if (mode.customization) {
_canHelp = (mode.customization.help!==false);
_isShowMacros = (mode.customization.macros!==false);
} }
}, },

View file

@ -190,13 +190,17 @@ define([
$('#toolbar-preview, #toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled'); $('#toolbar-preview, #toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
}, },
deactivateEditControls: function() { deactivateEditControls: function(enableDownload) {
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled'); $('#toolbar-edit, #toolbar-add').addClass('disabled');
if (enableDownload)
PE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
else
$('#toolbar-settings').addClass('disabled');
}, },
onCoAuthoringDisconnect: function() { onCoAuthoringDisconnect: function(enableDownload) {
this.isDisconnected = true; this.isDisconnected = true;
this.deactivateEditControls(); this.deactivateEditControls(enableDownload);
$('#toolbar-undo').toggleClass('disabled', true); $('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true); $('#toolbar-redo').toggleClass('disabled', true);
PE.getController('AddContainer').hideModal(); PE.getController('AddContainer').hideModal();

View file

@ -107,18 +107,24 @@ define([
}, },
setMode: function (mode) { setMode: function (mode) {
isEdit = mode.isEdit; if (mode.isDisconnected) {
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; canEdit = isEdit = false;
canDownload = mode.canDownload || mode.canDownloadOrigin; if (!mode.enableDownload)
canPrint = mode.canPrint; canPrint = canDownload = false;
} else {
isEdit = mode.isEdit;
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
canDownload = mode.canDownload || mode.canDownloadOrigin;
canPrint = mode.canPrint;
if (mode.customization && mode.canBrandingExt) { if (mode.customization && mode.canBrandingExt) {
canAbout = (mode.customization.about!==false); canAbout = (mode.customization.about!==false);
} }
if (mode.customization) { if (mode.customization) {
canHelp = (mode.customization.help!==false); canHelp = (mode.customization.help!==false);
isShowMacros = (mode.customization.macros!==false); isShowMacros = (mode.customization.macros!==false);
}
} }
}, },

View file

@ -209,13 +209,17 @@ define([
$('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled'); $('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
}, },
deactivateEditControls: function() { deactivateEditControls: function(enableDownload) {
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled'); $('#toolbar-edit, #toolbar-add').addClass('disabled');
if (enableDownload)
SSE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
else
$('#toolbar-settings').addClass('disabled');
}, },
onCoAuthoringDisconnect: function() { onCoAuthoringDisconnect: function(enableDownload) {
this.isDisconnected = true; this.isDisconnected = true;
this.deactivateEditControls(); this.deactivateEditControls(enableDownload);
$('#toolbar-undo').toggleClass('disabled', true); $('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true); $('#toolbar-redo').toggleClass('disabled', true);
SSE.getController('AddContainer').hideModal(); SSE.getController('AddContainer').hideModal();

View file

@ -116,18 +116,24 @@ define([
}, },
setMode: function (mode) { setMode: function (mode) {
isEdit = mode.isEdit; if (mode.isDisconnected) {
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; canEdit = isEdit = false;
canDownload = mode.canDownload || mode.canDownloadOrigin; if (!mode.enableDownload)
canPrint = mode.canPrint; canPrint = canDownload = false;
} else {
isEdit = mode.isEdit;
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
canDownload = mode.canDownload || mode.canDownloadOrigin;
canPrint = mode.canPrint;
if (mode.customization && mode.canBrandingExt) { if (mode.customization && mode.canBrandingExt) {
canAbout = (mode.customization.about!==false); canAbout = (mode.customization.about!==false);
} }
if (mode.customization) { if (mode.customization) {
canHelp = (mode.customization.help!==false); canHelp = (mode.customization.help!==false);
isShowMacros = (mode.customization.macros!==false); isShowMacros = (mode.customization.macros!==false);
}
} }
}, },