Fix Bug 40582
This commit is contained in:
parent
ad930bd8e3
commit
fdc734d898
|
@ -1010,7 +1010,7 @@ define([
|
||||||
|
|
||||||
// internal
|
// internal
|
||||||
|
|
||||||
updateComments: function (needRender, disableSort) {
|
updateComments: function (needRender, disableSort, loadText) {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.updateCommentsTime = new Date();
|
me.updateCommentsTime = new Date();
|
||||||
if (me.timerUpdateComments===undefined)
|
if (me.timerUpdateComments===undefined)
|
||||||
|
@ -1018,12 +1018,12 @@ define([
|
||||||
if ((new Date()) - me.updateCommentsTime>100) {
|
if ((new Date()) - me.updateCommentsTime>100) {
|
||||||
clearInterval(me.timerUpdateComments);
|
clearInterval(me.timerUpdateComments);
|
||||||
me.timerUpdateComments = undefined;
|
me.timerUpdateComments = undefined;
|
||||||
me.updateCommentsView(needRender, disableSort);
|
me.updateCommentsView(needRender, disableSort, loadText);
|
||||||
}
|
}
|
||||||
}, 25);
|
}, 25);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateCommentsView: function (needRender, disableSort) {
|
updateCommentsView: function (needRender, disableSort, loadText) {
|
||||||
if (needRender && !this.view.isVisible()) {
|
if (needRender && !this.view.isVisible()) {
|
||||||
this.view.needRender = needRender;
|
this.view.needRender = needRender;
|
||||||
this.onUpdateFilter(this.filter, true);
|
this.onUpdateFilter(this.filter, true);
|
||||||
|
@ -1055,6 +1055,8 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.view.update();
|
this.view.update();
|
||||||
|
|
||||||
|
loadText && this.view.loadText();
|
||||||
},
|
},
|
||||||
findComment: function (uid) {
|
findComment: function (uid) {
|
||||||
return this.collection.findWhere({uid: uid});
|
return this.collection.findWhere({uid: uid});
|
||||||
|
@ -1156,9 +1158,25 @@ define([
|
||||||
reply.set('usercolor', (user) ? user.get('color') : null, {silent: true});
|
reply.set('usercolor', (user) ? user.get('color') : null, {silent: true});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.updateComments(true);
|
this.view.saveText();
|
||||||
if (this.getPopover().isVisible())
|
this.updateComments(true, undefined, true);
|
||||||
this.getPopover().update(true);
|
if (this.getPopover().isVisible() && !this.isDummyComment) {
|
||||||
|
var t = this,
|
||||||
|
popover = this.getPopover(),
|
||||||
|
text = '';
|
||||||
|
this.popoverComments.each(function (model) {
|
||||||
|
if (model.get('editTextInPopover')) {
|
||||||
|
text = popover.getEditText();
|
||||||
|
} else if (model.get('showReplyInPopover')) {
|
||||||
|
text = t.popover.getEditText();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
popover.update(true);
|
||||||
|
if (text.length) {
|
||||||
|
var textBox = popover.commentsView.getTextBox();
|
||||||
|
textBox && textBox.val(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
readSDKComment: function (id, data) {
|
readSDKComment: function (id, data) {
|
||||||
|
|
Loading…
Reference in a new issue