diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 43b07abda..b9a8ef37d 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -107,6 +107,8 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this)); + Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this)); }, @@ -364,6 +366,17 @@ define([ } }, + onApiCoAuthoringDisconnect: function() { + if (this.header) { + if (this.header.btnDownload) + this.header.btnDownload.hide(); + if (this.header.btnPrint) + this.header.btnPrint.hide(); + if (this.header.btnEdit) + this.header.btnEdit.hide(); + } + }, + textFitPage: 'Fit to Page', textFitWidth: 'Fit to Width' }, DE.Controllers.Viewport)); diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 87aee107b..ac65b35ea 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -114,6 +114,8 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this)); + Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this)); }, @@ -402,6 +404,17 @@ define([ } }, + onApiCoAuthoringDisconnect: function() { + if (this.header) { + if (this.header.btnDownload) + this.header.btnDownload.hide(); + if (this.header.btnPrint) + this.header.btnPrint.hide(); + if (this.header.btnEdit) + this.header.btnEdit.hide(); + } + }, + textFitPage: 'Fit to Page', textFitWidth: 'Fit to Width' }, PE.Controllers.Viewport)); diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index aacac3680..13d390bcd 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -122,6 +122,8 @@ define([ this.api.asc_registerCallback('asc_onSheetsChanged', this.onApiSheetChanged.bind(this)); this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', this.onApiSheetChanged.bind(this)); this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.bind(this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this)); + Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this)); }, onAppShowed: function (config) { @@ -409,6 +411,17 @@ define([ } }, + onApiCoAuthoringDisconnect: function() { + if (this.header) { + if (this.header.btnDownload) + this.header.btnDownload.hide(); + if (this.header.btnPrint) + this.header.btnPrint.hide(); + if (this.header.btnEdit) + this.header.btnEdit.hide(); + } + }, + textHideFBar: 'Hide Formula Bar', textHideHeadings: 'Hide Headings', textHideGridlines: 'Hide Gridlines',