Make sure threads have commentSide attribute

This should be set on the thread level because in a unified view, it is
possible for a thread group to contain threads from both the 'left' and
the 'right' sides.

Change-Id: Ia1f7d54423f5f424c98134224666d7f76c56de05
This commit is contained in:
Becky Siegel
2018-02-27 09:38:15 -08:00
parent b75dd4177c
commit eaca455fd4
3 changed files with 4 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ limitations under the License.
<template is="dom-repeat" items="[[_threads]]" as="thread">
<gr-diff-comment-thread
comments="[[thread.comments]]"
comment-side="[[commentSide]]"
comment-side="[[thread.commentSide]]"
is-on-parent="[[isOnParent]]"
parent-index="[[parentIndex]]"
change-num="[[changeNum]]"

View File

@@ -19,7 +19,6 @@
properties: {
changeNum: String,
commentSide: String,
comments: {
type: Array,
value() { return []; },
@@ -51,9 +50,10 @@
*
* @param {!Object} opt_range
*/
addNewThread(opt_range) {
addNewThread(commentSide, opt_range) {
this.push('_threads', {
comments: [],
commentSide,
patchNum: this.patchForNewThreads,
range: opt_range,
});

View File

@@ -448,7 +448,7 @@
let threadEl = this._getThread(threadGroupEl, opt_range);
if (!threadEl) {
threadGroupEl.addNewThread(opt_range);
threadGroupEl.addNewThread(commentSide, opt_range);
Polymer.dom.flush();
threadEl = this._getThread(threadGroupEl, opt_range);
}