Remove bouncing, set animation time to be constant (prevents temporary overalpping) and exclude ourselves.

This commit is contained in:
David Baker 2015-11-17 15:51:00 +00:00
parent e23b90abd5
commit 80c2bd0c7f
2 changed files with 5 additions and 21 deletions

View File

@ -1,15 +0,0 @@
var Velocity = require('velocity-animate');
// courtesy of https://github.com/julianshapiro/velocity/issues/283
// We only use easeOutBounce (easeInBounce is just sort of nonsensical)
function bounce( p ) {
var pow2,
bounce = 4;
while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
}
Velocity.Easings.easeOutBounce = function(p) {
return 1 - bounce(1 - p);
}

View File

@ -29,7 +29,6 @@ var ContextualMenu = require('../../../../ContextualMenu');
var TextForEvent = require('matrix-react-sdk/lib/TextForEvent'); var TextForEvent = require('matrix-react-sdk/lib/TextForEvent');
var Velociraptor = require('../../../../Velociraptor'); var Velociraptor = require('../../../../Velociraptor');
require('../../../../VelocityBounce');
var eventTileTypes = { var eventTileTypes = {
'm.room.message': 'molecules.MessageTile', 'm.room.message': 'molecules.MessageTile',
@ -90,9 +89,11 @@ module.exports = React.createClass({
if (!room) return []; if (!room) return [];
var myUserId = MatrixClientPeg.get().credentials.userId;
// get list of read receipts, sorted most recent first // get list of read receipts, sorted most recent first
var receipts = room.getReceiptsForEvent(this.props.mxEvent).filter(function(r) { var receipts = room.getReceiptsForEvent(this.props.mxEvent).filter(function(r) {
return r.type === "m.read"; return r.type === "m.read" && r.userId != myUserId;
}).sort(function(r1, r2) { }).sort(function(r1, r2) {
return r2.data.ts - r1.data.ts; return r2.data.ts - r1.data.ts;
}); });
@ -130,10 +131,8 @@ module.exports = React.createClass({
// and then it will drop down to its resting position // and then it will drop down to its resting position
startStyles.push({ top: topOffset, left: '0px' }); startStyles.push({ top: topOffset, left: '0px' });
enterTransitionOpts.push({ enterTransitionOpts.push({
// Sort of make it take a bit longer to fall in a way duration: 300,
// that would make my A level physics teacher cry. easing: 'easeOutCubic',
duration: Math.min(Math.log(Math.abs(topOffset)) * 200, 3000),
easing: 'easeOutBounce'
}); });
} }