FIX: Chrome scrolling page up when you expand likes
This commit is contained in:
parent
8baf5bb40d
commit
c3f08145b8
1 changed files with 10 additions and 0 deletions
|
@ -25,7 +25,17 @@ export default Ember.Mixin.create({
|
||||||
const buffer = [];
|
const buffer = [];
|
||||||
this.renderString(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(''));
|
$sel.html(buffer.join(''));
|
||||||
|
$(window).scrollTop(scrollTop);
|
||||||
},
|
},
|
||||||
|
|
||||||
rerenderString() {
|
rerenderString() {
|
||||||
|
|
Reference in a new issue