Empty aspect stream when no aspect selected on the left nav

This commit is contained in:
Gonzalo Rodriguez 2011-09-27 23:46:02 -03:00
parent dc0c23da2f
commit 372a472fbf
3 changed files with 15 additions and 1 deletions

View file

@ -56,3 +56,4 @@ en:
aspect_navigation: aspect_navigation:
select_all: "Select all" select_all: "Select all"
deselect_all: "Deselect all" deselect_all: "Deselect all"
no_aspects: "No aspects selected"

View file

@ -54,6 +54,8 @@
this.perform = function() { this.perform = function() {
if (self.noneSelected()) { if (self.noneSelected()) {
self.abortAjax(); self.abortAjax();
Diaspora.page.stream.empty();
Diaspora.page.stream.setHeaderTitle(Diaspora.I18n.t('aspect_navigation.no_aspects'));
self.fadeIn(); self.fadeIn();
} else { } else {
self.performAjax(); self.performAjax();

View file

@ -5,7 +5,9 @@
this.subscribe("widget/ready", function(evt, stream) { this.subscribe("widget/ready", function(evt, stream) {
$.extend(self, { $.extend(self, {
stream: $(stream) stream: $(stream),
mainStream: $(stream).find('#main_stream'),
headerTitle: $(stream).find('#aspect_stream_header > h3')
}); });
$.each(self.stream.find(".stream_element"), function() { $.each(self.stream.find(".stream_element"), function() {
@ -31,6 +33,15 @@
this.addPost = function(post) { this.addPost = function(post) {
self.streamElements[post.attr("id")] = self.instantiate("StreamElement", post); self.streamElements[post.attr("id")] = self.instantiate("StreamElement", post);
}; };
this.empty = function() {
self.mainStream.empty();
self.headerTitle.text(Diaspora.I18n.t('stream.no_aspects'));
};
this.setHeaderTitle = function(newTitle) {
self.headerTitle.text(newTitle);
};
}; };
Diaspora.Widgets.Stream = Stream; Diaspora.Widgets.Stream = Stream;