Hide download, print, edit buttons in the header when server is disconnected

This commit is contained in:
Julia Radzhabova 2018-05-15 14:27:41 +03:00
parent 9b618a5dff
commit 52029b5d19
3 changed files with 39 additions and 0 deletions

View file

@ -107,6 +107,8 @@ define([
setApi: function(api) { setApi: function(api) {
this.api = api; this.api = api;
this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this)); 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', textFitPage: 'Fit to Page',
textFitWidth: 'Fit to Width' textFitWidth: 'Fit to Width'
}, DE.Controllers.Viewport)); }, DE.Controllers.Viewport));

View file

@ -114,6 +114,8 @@ define([
setApi: function(api) { setApi: function(api) {
this.api = api; this.api = api;
this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this)); 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', textFitPage: 'Fit to Page',
textFitWidth: 'Fit to Width' textFitWidth: 'Fit to Width'
}, PE.Controllers.Viewport)); }, PE.Controllers.Viewport));

View file

@ -122,6 +122,8 @@ define([
this.api.asc_registerCallback('asc_onSheetsChanged', this.onApiSheetChanged.bind(this)); 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_onUpdateSheetViewSettings', this.onApiSheetChanged.bind(this));
this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.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) { 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', textHideFBar: 'Hide Formula Bar',
textHideHeadings: 'Hide Headings', textHideHeadings: 'Hide Headings',
textHideGridlines: 'Hide Gridlines', textHideGridlines: 'Hide Gridlines',