Merge branch 'stable' into develop

This commit is contained in:
Steffen van Bergerem 2015-10-02 23:42:36 +02:00
commit 7c777ca904
2 changed files with 5 additions and 5 deletions

View file

@ -82,6 +82,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
# 0.5.4.0
## Refactor
* Improve infinite scroll triggering [#6451](https://github.com/diaspora/diaspora/pull/6451)
## Bug fixes

View file

@ -95,12 +95,11 @@ app.views.InfScroll = app.views.Base.extend({
},
infScroll : function() {
var $window = $(window)
, distFromTop = $window.height() + $window.scrollTop()
, distFromBottom = $(document).height() - distFromTop
, bufferPx = 500;
var $window = $(window),
distFromBottom = $(document).height() - $window.height() - $window.scrollTop(),
elementDistance = this.$el.children().last().offset().top - $window.scrollTop() - 500;
if(distFromBottom < bufferPx) {
if(elementDistance <= 0 || distFromBottom < 500) {
this.trigger("loadMore");
}
}