add aspects route to backbone router
This commit is contained in:
parent
572e6b5639
commit
4a07602ad3
1 changed files with 25 additions and 3 deletions
|
|
@ -11,8 +11,8 @@ app.Router = Backbone.Router.extend({
|
||||||
"stream": "stream",
|
"stream": "stream",
|
||||||
"participate": "stream",
|
"participate": "stream",
|
||||||
"explore": "stream",
|
"explore": "stream",
|
||||||
"aspects": "stream",
|
"aspects": "aspects",
|
||||||
"aspects:query": "stream",
|
"aspects/stream": "aspects_stream",
|
||||||
"commented": "stream",
|
"commented": "stream",
|
||||||
"liked": "stream",
|
"liked": "stream",
|
||||||
"mentions": "stream",
|
"mentions": "stream",
|
||||||
|
|
@ -74,13 +74,35 @@ app.Router = Backbone.Router.extend({
|
||||||
followedTagsView.setupAutoSuggest();
|
followedTagsView.setupAutoSuggest();
|
||||||
|
|
||||||
app.tagFollowings.add(preloads.tagFollowings);
|
app.tagFollowings.add(preloads.tagFollowings);
|
||||||
|
|
||||||
if(name) {
|
if(name) {
|
||||||
var followedTagsAction = new app.views.TagFollowingAction(
|
var followedTagsAction = new app.views.TagFollowingAction(
|
||||||
{tagText: name}
|
{tagText: name}
|
||||||
);
|
);
|
||||||
$("#author_info").prepend(followedTagsAction.render().el)
|
$("#author_info").prepend(followedTagsAction.render().el)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
aspects : function(){
|
||||||
|
app.aspects = new app.collections.Aspects(app.currentUser.get('aspects'));
|
||||||
|
var aspects_list = new app.views.AspectsList({ collection: app.aspects });
|
||||||
|
aspects_list.render();
|
||||||
|
},
|
||||||
|
|
||||||
|
aspects_stream : function(){
|
||||||
|
|
||||||
|
var ids = app.aspects.selectedAspects();
|
||||||
|
|
||||||
|
app.stream = new app.models.Stream([], {url: '/aspects'});
|
||||||
|
app.stream.fetch({data: $.param({a_ids:ids})});
|
||||||
|
|
||||||
|
app.page = new app.views.Stream({model : app.stream});
|
||||||
|
app.publisher = new app.views.Publisher({collection : app.stream.items});
|
||||||
|
|
||||||
|
var streamFacesView = new app.views.StreamFaces({collection : app.stream.items});
|
||||||
|
|
||||||
|
$("#main_stream").html(app.page.render().el);
|
||||||
|
$('#selected_aspect_contacts .content').html(streamFacesView.render().el);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue