Unverified Commit 3643612b authored by Dennis Schubert's avatar Dennis Schubert Committed by Benjamin Neff
Browse files

Back to Top: Make sure to re-check the visibility after the scrolling is done

If a user scrolls just below the 1000px threshold and clicks the back-to-top button within 250ms, we'll never hide the button as the scroll event gets throttled away. That's rather inconvenient.

closes #7729
parent 8e88f4b1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@

## Features
* Add basic html5 audio/video embedding support [#6418](https://github.com/diaspora/diaspora/pull/6418)
* Add the back-to-top button to all pages [#7729](https://github.com/diaspora/diaspora/pull/7729)

# 0.7.3.1

+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ app.views.BackToTop = Backbone.View.extend({

  backToTop: function(evt) {
    evt.preventDefault();
    $("html, body").animate({scrollTop: 0});
    $("html, body").animate({scrollTop: 0}, this.toggleVisibility);
  },

  toggleVisibility: function() {
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ describe("app.views.BackToTop", function() {
    it("scrolls to the top of the page", function() {
      var spy = spyOn($.fn, "animate");
      this.view.backToTop($.Event());
      expect(spy).toHaveBeenCalledWith({scrollTop: 0});
      expect(spy).toHaveBeenCalledWith({scrollTop: 0}, jasmine.any(Function));
    });
  });