diff --git a/MessageList.js b/MessageList.js index a10b48d..3a44484 100644 --- a/MessageList.js +++ b/MessageList.js @@ -167,24 +167,24 @@ var MessageList = React.createClass({ }, getPageSize: function() { - return Math.round(this.refs.scroll.offsetHeight / (this.props.layout == 'message-on-right' ? 60 : 30)); + return Math.floor(this.refs.scroll.offsetHeight / (this.props.layout == 'message-on-right' ? 60 : 30)); }, getItemOffset: function(index) { - var n = 0, top = this.refs.title.offsetHeight, p; + var n = 0, top = 0, p; + var h = (this.props.layout == 'message-on-right' ? 60 : 30); for (var i = 0; i < (this.props.groups||[]).length; i++) { p = n; n += (i > 0 ? 1 : 0)+this.props.groups[i].messageCount; if (index < n) { - if (index > p) - top += (i > 0 ? 30 : 0) + (this.props.layout == 'message-on-right' ? 60 : 30)*(index-p-1); + top += (index > p && i > 0 ? 30+h*(index-p-1) : h*(index-p)); break; } - top += (i > 0 ? 30 : 0) + (this.props.layout == 'message-on-right' ? 60 : 30)*this.props.groups[i].messageCount; + top += (i > 0 ? 30 : 0) + h*this.props.groups[i].messageCount; } - return [ top, (this.props.layout == 'message-on-right' && (index == 0 || index != p) ? 60 : 30) ]; + return [ top, index == p && i > 0 ? 30 : h ]; }, getScrollPaddingTop: function() { @@ -262,6 +262,14 @@ var MessageList = React.createClass({ })} + }, + componentDidMount: function() + { + window.addEventListener('resize', this.changeFirstDay); + }, + componentWillUnmount: function() + { + window.removeEventListener('resize', this.changeFirstDay); } }); diff --git a/MessageView.js b/MessageView.js index c7158e8..b737ae9 100644 --- a/MessageView.js +++ b/MessageView.js @@ -53,7 +53,6 @@ var MessageView = React.createClass({ }); } } - // TODO list attachments return
@@ -110,7 +109,17 @@ var MessageView = React.createClass({ {msg.props.replyto ?
Reply-to
-
{msg.props.replyto[0]+' <'+msg.props.replyto[1]+'>'}
+
+ {[msg.props.replyto].map(a => ' : a[1]}>{a[0] || a[1]})} +
+
+ : null} + {msg.props.attachments && msg.props.attachments.length ? +
+
Attachments
+
+ {msg.props.attachments.map(a => {a[0]+' ('+Util.formatBytes(a[2])+')'})} +
: null}
diff --git a/Store.js b/Store.js index 41d3475..85a9f89 100644 --- a/Store.js +++ b/Store.js @@ -158,7 +158,6 @@ var Store = module.exports = { loadMessages: function(start, count) { - console.log('load '+start+'..'+count); var p = { ...Store.get('folderParams') }; p.offset = start; p.limit = count;