@@ -145,9 +145,11 @@ module.exports = React.createClass({
145
145
var style = {
146
146
left : left + 'px' ,
147
147
top : '0px' ,
148
- visibility : i < MAX_READ_AVATARS || this . state . allReadAvatars ? 'visible' : 'hidden'
148
+ visibility : ( ( i < MAX_READ_AVATARS ) || this . state . allReadAvatars ) ? 'visible' : 'hidden'
149
149
} ;
150
150
151
+ //console.log("i = " + i + ", MAX_READ_AVATARS = " + MAX_READ_AVATARS + ", allReadAvatars = " + this.state.allReadAvatars + " visibility = " + style.visibility);
152
+
151
153
// add to the start so the most recent is on the end (ie. ends up rightmost)
152
154
avatars . unshift (
153
155
< MemberAvatar key = { member . userId } member = { member }
@@ -161,28 +163,29 @@ module.exports = React.createClass({
161
163
) ;
162
164
// TODO: we keep the extra read avatars in the dom to make animation simpler
163
165
// we could optimise this to reduce the dom size.
164
- if ( i < MAX_READ_AVATARS - 1 || this . state . allReadAvatars ) {
166
+ if ( i < MAX_READ_AVATARS - 1 || this . state . allReadAvatars ) { // XXX: where does this -1 come from? is it to make the max'th avatar animate properly?
165
167
left -= 15 ;
166
168
}
167
169
}
170
+ var editButton ;
168
171
if ( ! this . state . allReadAvatars ) {
169
172
var remainder = receipts . length - MAX_READ_AVATARS ;
170
173
var remText ;
171
- left -= 15 ;
174
+ if ( i >= MAX_READ_AVATARS - 1 ) left -= 15 ;
172
175
if ( remainder > 0 ) {
173
176
remText = < span className = "mx_EventTile_readAvatarRemainder"
174
177
onClick = { this . toggleAllReadAvatars }
175
178
style = { { left : left } } > { remainder } +
176
179
</ span > ;
180
+ left -= 15 ;
177
181
}
182
+ editButton = (
183
+ < input style = { { left : left } }
184
+ type = "image" src = "img/edit.png" alt = "Edit" width = "14" height = "14"
185
+ className = "mx_EventTile_editButton" onClick = { this . onEditClicked } />
186
+ ) ;
178
187
}
179
188
180
- var editButton = (
181
- < input style = { { left : left + 15 } }
182
- type = "image" src = "img/edit.png" alt = "Edit" width = "14" height = "14"
183
- className = "mx_EventTile_editButton" onClick = { this . onEditClicked } />
184
- ) ;
185
-
186
189
return < span className = "mx_EventTile_readAvatars" ref = { this . collectReadAvatarNode } >
187
190
{ editButton }
188
191
{ remText }
0 commit comments