[DE] Disable and hide comments when preview review changes.
This commit is contained in:
parent
97b20715f0
commit
cfed1c50b8
|
@ -73,6 +73,7 @@ define([
|
||||||
subEditStrings : {},
|
subEditStrings : {},
|
||||||
filter : undefined,
|
filter : undefined,
|
||||||
hintmode : false,
|
hintmode : false,
|
||||||
|
previewmode: false,
|
||||||
isSelectedComment : false,
|
isSelectedComment : false,
|
||||||
uids : [],
|
uids : [],
|
||||||
oldUids : [],
|
oldUids : [],
|
||||||
|
@ -143,6 +144,7 @@ define([
|
||||||
this.currentUserName = data.config.user.fullname;
|
this.currentUserName = data.config.user.fullname;
|
||||||
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
|
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
|
||||||
this.hintmode = data['hintmode'] || false;
|
this.hintmode = data['hintmode'] || false;
|
||||||
|
this.previewmode = data['previewmode'] || false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setApi: function (api) {
|
setApi: function (api) {
|
||||||
|
@ -253,6 +255,8 @@ define([
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
onShowComment: function (id, selected) {
|
onShowComment: function (id, selected) {
|
||||||
|
if (this.previewmode) return;
|
||||||
|
|
||||||
var comment = this.findComment(id, undefined);
|
var comment = this.findComment(id, undefined);
|
||||||
if (comment) {
|
if (comment) {
|
||||||
if (null !== comment.get('quote')) {
|
if (null !== comment.get('quote')) {
|
||||||
|
@ -759,6 +763,7 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onApiShowComment: function (uids, posX, posY, leftX, opts, hint) {
|
onApiShowComment: function (uids, posX, posY, leftX, opts, hint) {
|
||||||
|
if (this.previewmode) return;
|
||||||
this.isModeChanged = false;
|
this.isModeChanged = false;
|
||||||
|
|
||||||
if (hint && this.isSelectedComment && (0 === _.difference(this.uids, uids).length)) {
|
if (hint && this.isSelectedComment && (0 === _.difference(this.uids, uids).length)) {
|
||||||
|
@ -874,6 +879,8 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onApiUpdateCommentPosition: function (uids, posX, posY, leftX) {
|
onApiUpdateCommentPosition: function (uids, posX, posY, leftX) {
|
||||||
|
if (this.previewmode) return;
|
||||||
|
|
||||||
var i, useAnimation = false,
|
var i, useAnimation = false,
|
||||||
comment = null,
|
comment = null,
|
||||||
text = undefined,
|
text = undefined,
|
||||||
|
@ -1346,6 +1353,13 @@ define([
|
||||||
getView: function(name) {
|
getView: function(name) {
|
||||||
return !name && this.view ?
|
return !name && this.view ?
|
||||||
this.view : Backbone.Controller.prototype.getView.call(this, name);
|
this.view : Backbone.Controller.prototype.getView.call(this, name);
|
||||||
|
},
|
||||||
|
|
||||||
|
setPreviewMode: function(mode) {
|
||||||
|
this.previewmode = mode;
|
||||||
|
if (this.getPopover())
|
||||||
|
this.getPopover().hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, Common.Controllers.Comments || {}));
|
}, Common.Controllers.Comments || {}));
|
||||||
});
|
});
|
|
@ -530,6 +530,9 @@ define([
|
||||||
var leftMenu = app.getController('LeftMenu').leftMenu;
|
var leftMenu = app.getController('LeftMenu').leftMenu;
|
||||||
leftMenu.btnComments.setDisabled(disable);
|
leftMenu.btnComments.setDisabled(disable);
|
||||||
if (disable) leftMenu.close();
|
if (disable) leftMenu.close();
|
||||||
|
var comments = app.getController('Common.Controllers.Comments');
|
||||||
|
if (comments)
|
||||||
|
comments.setPreviewMode(disable);
|
||||||
|
|
||||||
if (this.view) {
|
if (this.view) {
|
||||||
this.view.$el.find('.no-group-mask').css('opacity', 1);
|
this.view.$el.find('.no-group-mask').css('opacity', 1);
|
||||||
|
|
Loading…
Reference in a new issue