From dad7205a5e407c9dee85827baeda42a385d51e29 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 22 Jun 2021 15:04:10 +0300 Subject: [PATCH] [SSE] Show protected sheet --- .../main/app/controller/WBProtection.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/controller/WBProtection.js b/apps/spreadsheeteditor/main/app/controller/WBProtection.js index 29dccb812..49b52b5c5 100644 --- a/apps/spreadsheeteditor/main/app/controller/WBProtection.js +++ b/apps/spreadsheeteditor/main/app/controller/WBProtection.js @@ -83,6 +83,8 @@ define([ if (api) { this.api = api; 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)); } }, @@ -247,6 +249,7 @@ define([ resolve(); })).then(function () { 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); }, + 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() { this.SetDisabled(true); }