Empty aspect stream when no aspect selected on the left nav
This commit is contained in:
parent
dc0c23da2f
commit
372a472fbf
3 changed files with 15 additions and 1 deletions
|
|
@ -56,3 +56,4 @@ en:
|
|||
aspect_navigation:
|
||||
select_all: "Select all"
|
||||
deselect_all: "Deselect all"
|
||||
no_aspects: "No aspects selected"
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@
|
|||
this.perform = function() {
|
||||
if (self.noneSelected()) {
|
||||
self.abortAjax();
|
||||
Diaspora.page.stream.empty();
|
||||
Diaspora.page.stream.setHeaderTitle(Diaspora.I18n.t('aspect_navigation.no_aspects'));
|
||||
self.fadeIn();
|
||||
} else {
|
||||
self.performAjax();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
this.subscribe("widget/ready", function(evt, stream) {
|
||||
$.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() {
|
||||
|
|
@ -31,6 +33,15 @@
|
|||
this.addPost = function(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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue