mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 11:15:14 +08:00
HACK: remove jarring scroll when hitting back from topic
This commit is contained in:
parent
fc71662a13
commit
3a9f0445bb
|
@ -186,7 +186,9 @@ Ember.DiscourseLocation = Ember.Object.extend({
|
|||
if (self.getURL() === self._previousURL) { return; }
|
||||
}
|
||||
var url = self.getURL();
|
||||
popstateCallbacks.forEach(function(cb) { cb(url); });
|
||||
popstateCallbacks.forEach(function(cb) {
|
||||
cb(url);
|
||||
});
|
||||
callback(url);
|
||||
});
|
||||
},
|
||||
|
@ -226,6 +228,16 @@ Ember.CloakedCollectionView.reopen({
|
|||
_watchForPopState: function() {
|
||||
var self = this,
|
||||
cb = function() {
|
||||
// Sam: This is a hack, but a very important one
|
||||
// Due to the way we use replace state the back button works strangely
|
||||
//
|
||||
// If you visit a topic from the front page, scroll a bit around and then hit back
|
||||
// you notice that first the page scrolls a bit (within the topic) and then it goes back
|
||||
// this transition is jarring and adds uneeded rendering costs.
|
||||
//
|
||||
// To repro comment the hack out and wack a debugger statement here and in
|
||||
// topic_route deactivate
|
||||
$('.posts,#topic-title').hide();
|
||||
self.cleanUp();
|
||||
self.set('controller.postStream.loaded', false);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user