FIX: Testing environment did NOT like Discourse.URL

This commit is contained in:
Robin Ward 2014-02-12 11:31:11 -05:00
parent 721472dab4
commit 62592215f4

View file

@ -26,8 +26,10 @@ Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.LoadMore, {
},
_readjustScrollPosition: function() {
var scrollTo = Discourse.Session.currentProp('topicListScrollPosition');
if (Discourse.URL.get('router.url').indexOf('/more') === -1) { scrollTo = 0; }
var scrollTo = Discourse.Session.currentProp('topicListScrollPosition'),
url = document.location.href;
if (url && url.indexOf('/more') === -1) { scrollTo = 0; }
if (typeof scrollTo !== "undefined") {
Em.run.schedule('afterRender', function() {