[SSE] Fix Bug 49232

This commit is contained in:
Julia Radzhabova 2021-03-23 18:16:31 +03:00
parent 04517b0477
commit 9b56b8b253
3 changed files with 16 additions and 5 deletions

View file

@ -501,7 +501,10 @@ define([
onClear: function(menu, item) { onClear: function(menu, item) {
if (this.api) { if (this.api) {
this.api.asc_emptyCells(item.value); if (item.value == Asc.c_oAscCleanOptions.Comments) {
this.api.asc_RemoveAllComments(!this.permissions.canDeleteComments, true);// 1 param = true if remove only my comments, 2 param - remove current comments
} else
this.api.asc_emptyCells(item.value, item.value == Asc.c_oAscCleanOptions.All && !this.permissions.canDeleteComments);
Common.NotificationCenter.trigger('edit:complete', this.documentHolder); Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Clear'); Common.component.Analytics.trackEvent('DocumentHolder', 'Clear');

View file

@ -1429,8 +1429,12 @@ define([
}, },
onClearStyleMenu: function(menu, item, e) { onClearStyleMenu: function(menu, item, e) {
if (this.api) if (this.api) {
this.api.asc_emptyCells(item.value); if (item.value == Asc.c_oAscCleanOptions.Comments) {
this.api.asc_RemoveAllComments(!this.mode.canDeleteComments, true);// 1 param = true if remove only my comments, 2 param - remove current comments
} else
this.api.asc_emptyCells(item.value, item.value == Asc.c_oAscCleanOptions.All && !this.mode.canDeleteComments);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Clear'); Common.component.Analytics.trackEvent('ToolBar', 'Clear');

View file

@ -54,7 +54,8 @@ define([
var _actionSheets = [], var _actionSheets = [],
_isEdit = false, _isEdit = false,
_canViewComments = true, _canViewComments = true,
_isComments = false; _isComments = false,
_canDeleteComments = false;
function openLink(url) { function openLink(url) {
var newDocumentPage = window.open(url, '_blank'); var newDocumentPage = window.open(url, '_blank');
@ -95,6 +96,7 @@ define([
this.api.asc_registerCallback('asc_onSetAFDialog', _.bind(this.onApiFilterOptions, this)); this.api.asc_registerCallback('asc_onSetAFDialog', _.bind(this.onApiFilterOptions, this));
} }
_canViewComments = mode.canViewComments; _canViewComments = mode.canViewComments;
_canDeleteComments = mode.canDeleteComments;
}, },
// When our application is ready, lets get started // When our application is ready, lets get started
@ -187,7 +189,9 @@ define([
} }
} }
break; break;
case 'del': me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All); break; case 'del':
me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All, !_canDeleteComments);
break;
case 'wrap': me.api.asc_setCellTextWrap(true); break; case 'wrap': me.api.asc_setCellTextWrap(true); break;
case 'unwrap': me.api.asc_setCellTextWrap(false); break; case 'unwrap': me.api.asc_setCellTextWrap(false); break;
case 'edit': case 'edit':