diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index d16bbe35f..eb9d245aa 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -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'); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 96938a5b0..a18cf0a61 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -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'); diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 25d9d72bc..7ffb1e13a 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -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':