Merge branch '3681-infinite-scroll-on-contact-page' of git://github.com/asphxia/diaspora into develop

Conflicts:
	Changelog.md
This commit is contained in:
Jonne Haß 2013-04-10 18:24:47 +02:00
commit bef05c14d7
5 changed files with 28 additions and 6 deletions

View file

@ -118,6 +118,7 @@ by them self.
* Fix mobile buttons are only clickable when scrolled to the top. [#4102](https://github.com/diaspora/diaspora/issues/4102)
* Fix regression in bookmarklet causing uneditable post contents. [#4057](https://github.com/diaspora/diaspora/issues/4057)
* Redirect all mixed case tags to the lower case equivalents [#4058](https://github.com/diaspora/diaspora/issues/4058)
* Fix wrong message on infinite scroll on contacts page [#3681](https://github.com/diaspora/diaspora/issues/3681)
## Features

View file

@ -2,7 +2,8 @@ Diaspora.Pages.ContactsIndex = function() {
var self = this;
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'});
});

View file

@ -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) {
$('#main_stream').infinitescroll(self.options, function(newElements) {
self.globalPublish("stream/scrolled", newElements);

View file

@ -43,6 +43,7 @@ en:
public: "Public - your post will be visible to everyone and found by search engines"
infinite_scroll:
no_more: "No more posts."
no_more_contacts: "No more contacts."
aspect_dropdown:
add_to_aspect: "Add contact"
select_aspects: "Select aspects"

View file

@ -39,21 +39,39 @@ describe("app.views.Stream", function() {
describe("infScroll", function() {
// NOTE: inf scroll happens at 500px
it("fetches moar when the user is at the bottom of the page", function() {
beforeEach(function(){
spyOn($.fn, "height").andReturn(0);
spyOn($.fn, "scrollTop").andReturn(100);
spyOn(this.view.model, "fetch");
});
it("fetches moar when the user is at the bottom of the page", function() {
this.view.infScroll();
waitsFor(function(){
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(){
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");
});
});