FIX: Chrome scrolling page up when you expand likes

This commit is contained in:
Sam 2015-12-17 16:56:18 +11:00
parent 8baf5bb40d
commit c3f08145b8
1 changed files with 10 additions and 0 deletions

View File

@ -25,7 +25,17 @@ export default Ember.Mixin.create({
const buffer = [];
this.renderString(buffer);
// Chrome likes scrolling after HTML is set
// This happens if you navigate back and forth a few times
// Before removing this code confirm that this does not cause scrolling
// 1. Sort by views
// 2. Go to last post on one of the topics
// 3. Hit back
// 4. Go to last post on same topic
// 5. Expand likes
const scrollTop = $(window).scrollTop();
$sel.html(buffer.join(''));
$(window).scrollTop(scrollTop);
},
rerenderString() {