post-review tweaks

This commit is contained in:
Richard van der Hoff 2016-02-11 15:38:13 +00:00
parent f2377fa9fe
commit 0e0d0cf4f5
2 changed files with 76 additions and 72 deletions

View file

@ -23,7 +23,7 @@ module.exports = React.createClass({
displayName: 'MessagePanel',
propTypes: {
// true to give the component a 'display: hidden' style.
// true to give the component a 'display: none' style.
hidden: React.PropTypes.bool,
// the list of MatrixEvents to display
@ -117,19 +117,6 @@ module.exports = React.createClass({
}
},
render: function() {
var ScrollPanel = sdk.getComponent("structures.ScrollPanel");
return (
<ScrollPanel ref="scrollPanel" className="mx_RoomView_messagePanel"
onScroll={ this.props.onScroll }
onFillRequest={ this.props.onFillRequest }
style={ this.props.hidden ? { display: 'none' } : {} }
stickyBottom={ this.props.stickyBottom }>
{this._getEventTiles()}
</ScrollPanel>
);
},
_getEventTiles: function() {
var DateSeparator = sdk.getComponent('messages.DateSeparator');
var EventTile = sdk.getComponent('rooms.EventTile');
@ -240,15 +227,18 @@ module.exports = React.createClass({
// is the last element or not, because we only decide as we're going along.
if (readMarkerIndex === undefined && ghostIndex && ghostIndex <= ret.length) {
var hr;
hr = (<hr className="mx_RoomView_myReadMarker"
style={{opacity: 1, width: '99%'}}
ref={function(n) {
Velocity(n, {opacity: '0', width: '10%'},
{duration: 400, easing: 'easeInSine', delay: 1000});
}} />);
hr = (
<hr className="mx_RoomView_myReadMarker"
style={{opacity: 1, width: '99%'}}
ref={function(n) {
Velocity(n, {opacity: '0', width: '10%'},
{duration: 400, easing: 'easeInSine',
delay: 1000});
}}
/>);
ret.splice(ghostIndex, 0, (
<li key="_readuptoghost"
className="mx_RoomView_myReadMarker_container">
className="mx_RoomView_myReadMarker_container">
{hr}
</li>
));
@ -261,4 +251,17 @@ module.exports = React.createClass({
if (this.eventNodes == undefined) this.eventNodes = {};
this.eventNodes[eventId] = node;
},
render: function() {
var ScrollPanel = sdk.getComponent("structures.ScrollPanel");
return (
<ScrollPanel ref="scrollPanel" className="mx_RoomView_messagePanel"
onScroll={ this.props.onScroll }
onFillRequest={ this.props.onFillRequest }
style={ this.props.hidden ? { display: 'none' } : {} }
stickyBottom={ this.props.stickyBottom }>
{this._getEventTiles()}
</ScrollPanel>
);
},
});