[SSE] Fix clear format on protected sheet
This commit is contained in:
parent
cda49d94f8
commit
aad4885398
|
@ -537,7 +537,12 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onClear: function(menu, item, e) {
|
onClear: function(menu, item, e) {
|
||||||
Common.NotificationCenter.trigger('protect:check', this.onClearCallback, this, [menu, item]);
|
if (item.value == Asc.c_oAscCleanOptions.Format && !this._state.wsProps['FormatCells'] || item.value == Asc.c_oAscCleanOptions.All && !this.api.asc_checkLockedCells())
|
||||||
|
this.onClearCallback(menu, item);
|
||||||
|
else if (item.value == Asc.c_oAscCleanOptions.Comments) {
|
||||||
|
this._state.wsProps['Objects'] ? Common.NotificationCenter.trigger('showerror', Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical) : this.onClearCallback(menu, item);
|
||||||
|
} else
|
||||||
|
Common.NotificationCenter.trigger('protect:check', this.onClearCallback, this, [menu, item]);
|
||||||
},
|
},
|
||||||
|
|
||||||
onClearCallback: function(menu, item) {
|
onClearCallback: function(menu, item) {
|
||||||
|
|
|
@ -215,6 +215,7 @@ define([
|
||||||
Common.NotificationCenter.on('markfavorite', _.bind(this.markFavorite, this));
|
Common.NotificationCenter.on('markfavorite', _.bind(this.markFavorite, this));
|
||||||
Common.NotificationCenter.on('protect:check', _.bind(this.checkProtectedRange, this));
|
Common.NotificationCenter.on('protect:check', _.bind(this.checkProtectedRange, this));
|
||||||
Common.NotificationCenter.on('editing:disable', _.bind(this.onEditingDisable, this));
|
Common.NotificationCenter.on('editing:disable', _.bind(this.onEditingDisable, this));
|
||||||
|
Common.NotificationCenter.on('showerror', _.bind(this.onError, this));
|
||||||
|
|
||||||
this.stackLongActions = new Common.IrregularStack({
|
this.stackLongActions = new Common.IrregularStack({
|
||||||
strongCompare : this._compareActionStrong,
|
strongCompare : this._compareActionStrong,
|
||||||
|
@ -2176,7 +2177,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
checkProtectedRange: function(callback, scope, args) {
|
checkProtectedRange: function(callback, scope, args) {
|
||||||
var result = this.api.asc_isProtectedSheet() ? this.api.asc_checkActiveCellProtectedRange() : false;
|
var result = this.api.asc_isProtectedSheet() ? this.api.asc_checkProtectedRange() : false;
|
||||||
if (result===null) {
|
if (result===null) {
|
||||||
this.onError(Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical);
|
this.onError(Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1462,7 +1462,12 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onClearStyleMenu: function(menu, item, e) {
|
onClearStyleMenu: function(menu, item, e) {
|
||||||
Common.NotificationCenter.trigger('protect:check', this.onClearStyleMenuCallback, this, [menu, item]);
|
if (item.value == Asc.c_oAscCleanOptions.Format && !this._state.wsProps['FormatCells'] || item.value == Asc.c_oAscCleanOptions.All && !this.api.asc_checkLockedCells())
|
||||||
|
this.onClearStyleMenuCallback(menu, item);
|
||||||
|
else if (item.value == Asc.c_oAscCleanOptions.Comments) {
|
||||||
|
this._state.wsProps['Objects'] ? Common.NotificationCenter.trigger('showerror', Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical) : this.onClearStyleMenuCallback(menu, item);
|
||||||
|
} else
|
||||||
|
Common.NotificationCenter.trigger('protect:check', this.onClearStyleMenuCallback, this, [menu, item]);
|
||||||
},
|
},
|
||||||
|
|
||||||
onClearStyleMenuCallback: function(menu, item, e) {
|
onClearStyleMenuCallback: function(menu, item, e) {
|
||||||
|
|
Loading…
Reference in a new issue