[SSE] Show protected sheet

This commit is contained in:
Julia Radzhabova 2021-06-22 15:04:10 +03:00
parent bb9877ccca
commit dad7205a5e

View file

@ -83,6 +83,8 @@ define([
if (api) { if (api) {
this.api = api; this.api = api;
this.api.asc_registerCallback('asc_onChangeProtectWorkbook',_.bind(this.onChangeProtectWorkbook, this)); this.api.asc_registerCallback('asc_onChangeProtectWorkbook',_.bind(this.onChangeProtectWorkbook, this));
this.api.asc_registerCallback('asc_onChangeProtectSheet',_.bind(this.onChangeProtectSheet, this));
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.onApiSheetChanged, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
} }
}, },
@ -247,6 +249,7 @@ define([
resolve(); resolve();
})).then(function () { })).then(function () {
me.view.btnProtectWB.toggle(me.api.asc_isProtectedWorkbook(), true); me.view.btnProtectWB.toggle(me.api.asc_isProtectedWorkbook(), true);
me.view.btnProtectSheet.toggle(me.api.asc_isProtectedSheet(), true); //current sheet
}); });
}, },
@ -254,6 +257,14 @@ define([
this.view.btnProtectWB.toggle(this.api.asc_isProtectedWorkbook(), true); this.view.btnProtectWB.toggle(this.api.asc_isProtectedWorkbook(), true);
}, },
onChangeProtectSheet: function() {
this.view.btnProtectSheet.toggle(this.api.asc_isProtectedSheet(), true); //current sheet
},
onApiSheetChanged: function() {
this.view.btnProtectSheet.toggle(this.api.asc_isProtectedSheet(), true); //current sheet
},
onCoAuthoringDisconnect: function() { onCoAuthoringDisconnect: function() {
this.SetDisabled(true); this.SetDisabled(true);
} }