Disable comments remove when comments are not displayed

This commit is contained in:
Julia Radzhabova 2019-10-29 17:08:47 +03:00
parent b5c481dd65
commit fbb8c0c110
3 changed files with 15 additions and 1 deletions

View file

@ -69,6 +69,10 @@ define([
'FileMenu': { 'FileMenu': {
'settings:apply': this.applySettings.bind(this) 'settings:apply': this.applySettings.bind(this)
}, },
'LeftMenu': {
'comments:show': _.bind(this.commentsShowHide, this, 'show'),
'comments:hide': _.bind(this.commentsShowHide, this, 'hide')
},
'Common.Views.ReviewChanges': { 'Common.Views.ReviewChanges': {
'reviewchange:accept': _.bind(this.onAcceptClick, this), 'reviewchange:accept': _.bind(this.onAcceptClick, this),
'reviewchange:reject': _.bind(this.onRejectClick, this), 'reviewchange:reject': _.bind(this.onRejectClick, this),
@ -695,7 +699,9 @@ define([
if (state !== me.view.btnChat.pressed) if (state !== me.view.btnChat.pressed)
me.view.turnChat(state); me.view.turnChat(state);
}); });
}
if (me.view && me.view.btnCommentRemove) {
me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
} }
}, },
@ -774,6 +780,12 @@ define([
}); });
}, },
commentsShowHide: function(mode) {
if (!this.view) return;
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value);
},
textInserted: '<b>Inserted:</b>', textInserted: '<b>Inserted:</b>',
textDeleted: '<b>Deleted:</b>', textDeleted: '<b>Deleted:</b>',
textParaInserted: '<b>Paragraph Inserted</b> ', textParaInserted: '<b>Paragraph Inserted</b> ',

View file

@ -467,6 +467,7 @@ define([
if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible()) if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible())
value = resolved = true; value = resolved = true;
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide');
/** coauthoring end **/ /** coauthoring end **/
value = Common.localStorage.getItem("de-settings-fontrender"); value = Common.localStorage.getItem("de-settings-fontrender");

View file

@ -367,6 +367,7 @@ define([
if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible()) if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible())
value = resolved = true; value = resolved = true;
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide');
value = Common.localStorage.getBool("sse-settings-r1c1"); value = Common.localStorage.getBool("sse-settings-r1c1");
Common.Utils.InternalSettings.set("sse-settings-r1c1", value); Common.Utils.InternalSettings.set("sse-settings-r1c1", value);