diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 752b0f2c7..feb6b6554 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -143,13 +143,17 @@ define([ setMode: function (mode) { this.getView('Settings').setMode(mode); - if (mode.canBranding) - _licInfo = mode.customization; - _canReview = mode.canReview; - _isReviewOnly = mode.isReviewOnly; - _fileKey = mode.fileKey; - _isEdit = mode.isEdit; - _lang = mode.lang; + if (mode.isDisconnected) { + _canReview = _isReviewOnly = _isEdit = false; + } else { + if (mode.canBranding) + _licInfo = mode.customization; + _canReview = mode.canReview; + _isReviewOnly = mode.isReviewOnly; + _fileKey = mode.fileKey; + _isEdit = mode.isEdit; + _lang = mode.lang; + } }, initEvents: function () { diff --git a/apps/documenteditor/mobile/app/controller/Toolbar.js b/apps/documenteditor/mobile/app/controller/Toolbar.js index 44b967b7e..85d67bbbe 100644 --- a/apps/documenteditor/mobile/app/controller/Toolbar.js +++ b/apps/documenteditor/mobile/app/controller/Toolbar.js @@ -181,13 +181,17 @@ define([ $('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled'); }, - deactivateEditControls: function() { - $('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled'); + deactivateEditControls: function(enableDownload) { + $('#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.deactivateEditControls(); + this.deactivateEditControls(enableDownload); $('#toolbar-undo').toggleClass('disabled', true); $('#toolbar-redo').toggleClass('disabled', true); DE.getController('AddContainer').hideModal(); diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index a776baf18..ec3744151 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -106,22 +106,29 @@ define([ }, setMode: function (mode) { - _isEdit = mode.isEdit; - _canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; - _canDownload = mode.canDownload; - _canDownloadOrigin = mode.canDownloadOrigin; - _canReader = !mode.isEdit && !mode.isRestrictedEdit && mode.canReader; - _canPrint = mode.canPrint; - _canReview = mode.canReview; - _isReviewOnly = mode.isReviewOnly; + if (mode.isDisconnected) { + _canEdit = _isEdit = false; + _canReview = false; + _isReviewOnly = false; + if (!mode.enableDownload) + _canPrint = _canDownload = _canDownloadOrigin = false; + } else { + _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) { - _canAbout = (mode.customization.about!==false); - } - - if (mode.customization) { - _canHelp = (mode.customization.help!==false); - _isShowMacros = (mode.customization.macros!==false); + if (mode.customization) { + _canHelp = (mode.customization.help!==false); + _isShowMacros = (mode.customization.macros!==false); + } } }, diff --git a/apps/presentationeditor/mobile/app/controller/Toolbar.js b/apps/presentationeditor/mobile/app/controller/Toolbar.js index 7deeb4077..ca3bc5a3b 100644 --- a/apps/presentationeditor/mobile/app/controller/Toolbar.js +++ b/apps/presentationeditor/mobile/app/controller/Toolbar.js @@ -190,13 +190,17 @@ define([ $('#toolbar-preview, #toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled'); }, - deactivateEditControls: function() { - $('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled'); + deactivateEditControls: function(enableDownload) { + $('#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.deactivateEditControls(); + this.deactivateEditControls(enableDownload); $('#toolbar-undo').toggleClass('disabled', true); $('#toolbar-redo').toggleClass('disabled', true); PE.getController('AddContainer').hideModal(); diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index b97b74d95..1ddd08be4 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -107,18 +107,24 @@ define([ }, setMode: function (mode) { - isEdit = mode.isEdit; - canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; - canDownload = mode.canDownload || mode.canDownloadOrigin; - canPrint = mode.canPrint; + if (mode.isDisconnected) { + canEdit = isEdit = false; + if (!mode.enableDownload) + 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) { - canAbout = (mode.customization.about!==false); - } + if (mode.customization && mode.canBrandingExt) { + canAbout = (mode.customization.about!==false); + } - if (mode.customization) { - canHelp = (mode.customization.help!==false); - isShowMacros = (mode.customization.macros!==false); + if (mode.customization) { + canHelp = (mode.customization.help!==false); + isShowMacros = (mode.customization.macros!==false); + } } }, diff --git a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js index de9bf41cf..eb2ec8b63 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js @@ -209,13 +209,17 @@ define([ $('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled'); }, - deactivateEditControls: function() { - $('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled'); + deactivateEditControls: function(enableDownload) { + $('#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.deactivateEditControls(); + this.deactivateEditControls(enableDownload); $('#toolbar-undo').toggleClass('disabled', true); $('#toolbar-redo').toggleClass('disabled', true); SSE.getController('AddContainer').hideModal(); diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index 7ac8485b4..55cd4398f 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -116,18 +116,24 @@ define([ }, setMode: function (mode) { - isEdit = mode.isEdit; - canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights; - canDownload = mode.canDownload || mode.canDownloadOrigin; - canPrint = mode.canPrint; + if (mode.isDisconnected) { + canEdit = isEdit = false; + if (!mode.enableDownload) + 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) { - canAbout = (mode.customization.about!==false); - } + if (mode.customization && mode.canBrandingExt) { + canAbout = (mode.customization.about!==false); + } - if (mode.customization) { - canHelp = (mode.customization.help!==false); - isShowMacros = (mode.customization.macros!==false); + if (mode.customization) { + canHelp = (mode.customization.help!==false); + isShowMacros = (mode.customization.macros!==false); + } } },