Fix wrong message on infinite scroll on contact page
This commit is contained in:
parent
1b3664a157
commit
6df84ed703
5 changed files with 28 additions and 6 deletions
|
|
@ -54,6 +54,7 @@
|
||||||
* Show timestamp hovering a timeago string (stream) [#3149](https://github.com/diaspora/diaspora/issues/3149)
|
* Show timestamp hovering a timeago string (stream) [#3149](https://github.com/diaspora/diaspora/issues/3149)
|
||||||
* Fix reshare and like a post on a single post view [#3672](https://github.com/diaspora/diaspora/issues/3672)
|
* Fix reshare and like a post on a single post view [#3672](https://github.com/diaspora/diaspora/issues/3672)
|
||||||
* Fix posting multiple times the same content [#3272](https://github.com/diaspora/diaspora/issues/3272)
|
* Fix posting multiple times the same content [#3272](https://github.com/diaspora/diaspora/issues/3272)
|
||||||
|
* Fix wrong message on infinite scroll on contacts page [#3681](https://github.com/diaspora/diaspora/issues/3681)
|
||||||
|
|
||||||
## Gem Updates
|
## Gem Updates
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ Diaspora.Pages.ContactsIndex = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.subscribe("page/ready", function(evt, document) {
|
this.subscribe("page/ready", function(evt, document) {
|
||||||
self.infiniteScroll = self.instantiate("InfiniteScroll");
|
self.infiniteScroll = self.instantiate("InfiniteScroll",
|
||||||
|
{donetext: Diaspora.I18n.t("infinite_scroll.no_more_contacts"),});
|
||||||
$('.conversation_button').tooltip({placement: 'bottom'});
|
$('.conversation_button').tooltip({placement: 'bottom'});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.subscribe("widget/ready", function() {
|
this.subscribe("widget/ready", function(evt, opts) {
|
||||||
|
$.extend(self.options, opts);
|
||||||
if($('#main_stream').length !== 0) {
|
if($('#main_stream').length !== 0) {
|
||||||
$('#main_stream').infinitescroll(self.options, function(newElements) {
|
$('#main_stream').infinitescroll(self.options, function(newElements) {
|
||||||
self.globalPublish("stream/scrolled", newElements);
|
self.globalPublish("stream/scrolled", newElements);
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ en:
|
||||||
public: "Public - your post will be visible to everyone and found by search engines"
|
public: "Public - your post will be visible to everyone and found by search engines"
|
||||||
infinite_scroll:
|
infinite_scroll:
|
||||||
no_more: "No more posts."
|
no_more: "No more posts."
|
||||||
|
no_more_contacts: "No more contacts."
|
||||||
aspect_dropdown:
|
aspect_dropdown:
|
||||||
add_to_aspect: "Add contact"
|
add_to_aspect: "Add contact"
|
||||||
select_aspects: "Select aspects"
|
select_aspects: "Select aspects"
|
||||||
|
|
|
||||||
|
|
@ -39,21 +39,39 @@ describe("app.views.Stream", function() {
|
||||||
|
|
||||||
describe("infScroll", function() {
|
describe("infScroll", function() {
|
||||||
// NOTE: inf scroll happens at 500px
|
// NOTE: inf scroll happens at 500px
|
||||||
|
beforeEach(function(){
|
||||||
it("fetches moar when the user is at the bottom of the page", function() {
|
|
||||||
spyOn($.fn, "height").andReturn(0);
|
spyOn($.fn, "height").andReturn(0);
|
||||||
spyOn($.fn, "scrollTop").andReturn(100);
|
spyOn($.fn, "scrollTop").andReturn(100);
|
||||||
spyOn(this.view.model, "fetch");
|
spyOn(this.view.model, "fetch");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
it("fetches moar when the user is at the bottom of the page", function() {
|
||||||
this.view.infScroll();
|
this.view.infScroll();
|
||||||
|
|
||||||
waitsFor(function(){
|
waitsFor(function(){
|
||||||
return this.view.model.fetch.wasCalled
|
return this.view.model.fetch.wasCalled
|
||||||
}, "the infinite scroll function didn't fetch the stream")
|
}, "the infinite scroll function didn't fetch the stream");
|
||||||
|
|
||||||
runs(function(){
|
runs(function(){
|
||||||
expect(this.view.model.fetch).toHaveBeenCalled()
|
expect(this.view.model.fetch).toHaveBeenCalled()
|
||||||
})
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("shows the loader while fetching new posts", function() {
|
||||||
|
spyOn(this.view, "showLoader");
|
||||||
|
this.view.infScroll();
|
||||||
|
|
||||||
|
expect(this.view.showLoader).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it("doesnt try to fetch more content if already fetched all", function() {
|
||||||
|
spyOn($.fn, "unbind");
|
||||||
|
|
||||||
|
this.stream.trigger("allItemsLoaded", this.view);
|
||||||
|
|
||||||
|
expect($.fn.unbind).toHaveBeenCalledWith("scroll");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue