[SSE] Fix sheet protection

This commit is contained in:
Julia Radzhabova 2021-11-09 18:54:40 +03:00
parent 99030e2e8e
commit 3695549003

View file

@ -184,9 +184,7 @@ define([
handler: function(result, value, props) { handler: function(result, value, props) {
btn = result; btn = result;
if (result == 'ok') { if (result == 'ok') {
props.asc_setSheet(true); props.asc_setSheet(value, _.bind(me.onSetProtectedSheet, me));
value && props.asc_setPassword(value);
me.api.asc_setProtectedSheet(props);
} }
Common.NotificationCenter.trigger('edit:complete'); Common.NotificationCenter.trigger('edit:complete');
} }
@ -211,8 +209,7 @@ define([
btn = result; btn = result;
if (result == 'ok') { if (result == 'ok') {
if (me.api) { if (me.api) {
props.asc_setSheet(false, value); props.asc_setSheet(value && value.drmOptions ? value.drmOptions.asc_getPassword() : undefined, _.bind(me.onSetProtectedSheet, me));
me.api.asc_setProtectedSheet(props);
} }
Common.NotificationCenter.trigger('edit:complete'); Common.NotificationCenter.trigger('edit:complete');
} }
@ -224,12 +221,15 @@ define([
win.show(); win.show();
} else { } else {
props.asc_setSheet(false); props.asc_setSheet(undefined, _.bind(me.onSetProtectedSheet, me));
me.api.asc_setProtectedSheet(props);
} }
} }
}, },
onSetProtectedSheet: function(props) {
this.api.asc_setProtectedSheet(props);
},
onRangesClick: function() { onRangesClick: function() {
var me = this, var me = this,
props = me.api.asc_getProtectedRanges(), props = me.api.asc_getProtectedRanges(),