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