Merge pull request #753 from ONLYOFFICE/fix/bug_49232

[SSE] Fix Bug 49232
This commit is contained in:
Julia Radzhabova 2021-03-23 19:05:52 +03:00 committed by GitHub
commit fd86c9c369
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View file

@ -501,7 +501,10 @@ define([
onClear: function(menu, item) {
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.component.Analytics.trackEvent('DocumentHolder', 'Clear');

View file

@ -1429,8 +1429,12 @@ define([
},
onClearStyleMenu: function(menu, item, e) {
if (this.api)
this.api.asc_emptyCells(item.value);
if (this.api) {
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.component.Analytics.trackEvent('ToolBar', 'Clear');

View file

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