From cfed1c50b8ffbdbe7accc55c851479f5ec4256d5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 1 Sep 2017 15:25:31 +0300 Subject: [PATCH] [DE] Disable and hide comments when preview review changes. --- apps/common/main/lib/controller/Comments.js | 14 ++++++++++++++ apps/common/main/lib/controller/ReviewChanges.js | 3 +++ 2 files changed, 17 insertions(+) diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 0ffd06d725..bc59760ebf 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -73,6 +73,7 @@ define([ subEditStrings : {}, filter : undefined, hintmode : false, + previewmode: false, isSelectedComment : false, uids : [], oldUids : [], @@ -143,6 +144,7 @@ define([ this.currentUserName = data.config.user.fullname; this.sdkViewName = data['sdkviewname'] || this.sdkViewName; this.hintmode = data['hintmode'] || false; + this.previewmode = data['previewmode'] || false; } }, setApi: function (api) { @@ -253,6 +255,8 @@ define([ return false; }, onShowComment: function (id, selected) { + if (this.previewmode) return; + var comment = this.findComment(id, undefined); if (comment) { if (null !== comment.get('quote')) { @@ -759,6 +763,7 @@ define([ } }, onApiShowComment: function (uids, posX, posY, leftX, opts, hint) { + if (this.previewmode) return; this.isModeChanged = false; if (hint && this.isSelectedComment && (0 === _.difference(this.uids, uids).length)) { @@ -874,6 +879,8 @@ define([ } }, onApiUpdateCommentPosition: function (uids, posX, posY, leftX) { + if (this.previewmode) return; + var i, useAnimation = false, comment = null, text = undefined, @@ -1346,6 +1353,13 @@ define([ getView: function(name) { return !name && this.view ? this.view : Backbone.Controller.prototype.getView.call(this, name); + }, + + setPreviewMode: function(mode) { + this.previewmode = mode; + if (this.getPopover()) + this.getPopover().hide(); } + }, Common.Controllers.Comments || {})); }); \ No newline at end of file diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index a40603f12c..42df2d3f3d 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -530,6 +530,9 @@ define([ var leftMenu = app.getController('LeftMenu').leftMenu; leftMenu.btnComments.setDisabled(disable); if (disable) leftMenu.close(); + var comments = app.getController('Common.Controllers.Comments'); + if (comments) + comments.setPreviewMode(disable); if (this.view) { this.view.$el.find('.no-group-mask').css('opacity', 1);