Fix Bug 37570

This commit is contained in:
Julia Radzhabova 2018-05-17 17:34:04 +03:00
parent 2e15b1dbc1
commit 0523524829
2 changed files with 63 additions and 43 deletions

View file

@ -760,6 +760,7 @@ define([
user = usersStore.findWhere({id: userId});
if (user) {
this.getPopover() && this.getPopover().saveText();
this.view.saveText();
cur.set('lock', true);
cur.set('lockuserid', this.view.getUserName(user.get('username')));
}
@ -771,6 +772,7 @@ define([
if (cur) {
cur.set('lock', false);
this.getPopover() && this.getPopover().loadText();
this.view.loadText();
}
},
onApiShowComment: function (uids, posX, posY, leftX, opts, hint) {

View file

@ -183,7 +183,7 @@ define([
newHeight = 0;
function updateTextBoxHeight() {
scrollPos = $(view.scroller.el).scrollTop();
scrollPos = view.scroller.getScrollTop();
if (domTextBox.scrollHeight > domTextBox.clientHeight) {
textBox.css({height: (domTextBox.scrollHeight + lineHeight) + 'px'});
@ -841,6 +841,7 @@ define([
render: function () {
var me = this;
if (!this.rendered) {
this.$el.html(this.template({
textAddCommentToDoc: me.textAddCommentToDoc,
textAddComment: me.textAddComment,
@ -884,7 +885,7 @@ define([
event.preventDefault();
}
});
}
var CommentsPanelDataView = Common.UI.DataView.extend((function() {
var parentView = me;
@ -983,7 +984,6 @@ define([
})());
if (CommentsPanelDataView) {
if (this.commentsView) {
this.commentsView.render($('.messages-ct',me.el));
this.commentsView.onResetItems();
} else {
this.commentsView = new CommentsPanelDataView({
@ -1139,8 +1139,9 @@ define([
}
}
this.setupLayout();
if (!this.rendered) this.setupLayout();
this.update();
this.rendered = true;
return this;
},
@ -1204,6 +1205,23 @@ define([
this.showEditContainer(false);
},
saveText: function (clear) {
if (this.commentsView && this.commentsView.cmpEl.find('.lock-area').length<1) {
this.textVal = undefined;
if (!clear) {
this.textVal = this.commentsView.getActiveTextBoxVal();
} else {
this.commentsView.clearTextBoxBind();
}
}
},
loadText: function () {
if (this.textVal && this.commentsView) {
var textBox = this.commentsView.getTextBox();
textBox && textBox.val(this.textVal);
}
},
hookTextBox: function () {
var me = this,
textBox = this.commentsView.getTextBox();