From f992caadd7b163d27b2a85f2b7318e230bf01bf1 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 15 Feb 2016 18:12:38 +0000 Subject: [PATCH] Position read-marker 1/3 of the way down, not halfway down. --- src/components/structures/MessagePanel.js | 2 +- src/components/structures/RoomView.js | 4 ++-- src/components/structures/ScrollPanel.js | 6 +++--- src/components/structures/TimelinePanel.js | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 6d722a72b2..f2d2cf901b 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -140,7 +140,7 @@ module.exports = React.createClass({ * * pixelOffset gives the number of pixels between the bottom of the node * and the bottom of the container. If undefined, it will put the node - * in the middle of the container. + * 1/3 of the way down of the container. */ scrollToEvent: function(eventId, pixelOffset) { if (this.refs.scrollPanel) { diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 077ff50360..dfb28e9f2a 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -61,8 +61,8 @@ module.exports = React.createClass({ eventId: React.PropTypes.string, // where to position the event given by eventId, in pixels from the - // bottom of the viewport. If not given, will try to put the event in the - // middle of the viewprt. + // bottom of the viewport. If not given, will try to put the event + // 1/3 of the way down the viewport. eventPixelOffset: React.PropTypes.number, // ID of an event to highlight. If undefined, no event will be highlighted. diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index 514937f877..7269defe55 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -322,13 +322,13 @@ module.exports = React.createClass({ // pixelOffset gives the number of pixels between the bottom of the node // and the bottom of the container. If undefined, it will put the node - // in the middle of the container. + // 1/3 of the way down the container. scrollToToken: function(scrollToken, pixelOffset) { var scrollNode = this._getScrollNode(); - // default to the middle + // default to 1/3 of the way down if (pixelOffset === undefined) { - pixelOffset = scrollNode.clientHeight / 2; + pixelOffset = (scrollNode.clientHeight * 2)/ 3; } // save the desired scroll state. It's important we do this here rather diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index d80f3fe3f1..175faea1f3 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -68,8 +68,8 @@ var TimelinePanel = React.createClass({ eventId: React.PropTypes.string, // where to position the event given by eventId, in pixels from the - // bottom of the viewport. If not given, will try to put the event in the - // middle of the viewprt. + // bottom of the viewport. If not given, will try to put the event + // 1/3 of the way down the viewport. eventPixelOffset: React.PropTypes.number, // callback to determine if a user is the magic freeswitch conference @@ -427,7 +427,7 @@ var TimelinePanel = React.createClass({ * * @param {number?} pixelOffset offset to position the given event at * (pixels from the bottom of the view). If undefined, will put the - * event in the middle of the view. + * event 1/3 of the way down the view. * * returns a promise which will resolve when the load completes. */