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
This commit is contained in:
parent
8e88f4b183
commit
3643612b1c
3 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue