1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +02:00

Implement discussion composition and creation

This commit is contained in:
Toby Zerner
2015-02-06 14:07:15 +10:30
parent abd3aa2e1a
commit 28d213d868
9 changed files with 159 additions and 18 deletions

View File

@@ -8,11 +8,6 @@ export default Ember.Route.extend({
},
model: function(params) {
// Each time we view a discussion we want to reload its posts from
// scratch so that we have the most up-to-date data. Also, if we were
// to leave them in the store, the stream would try and render them
// which has the potential to be slow.
this.store.unloadAll('post');
return this.store.findQueryOne('discussion', params.id, {
include: 'posts',
near: params.start
@@ -49,6 +44,12 @@ export default Ember.Route.extend({
start: controller.get('start')
});
// Each time we view a discussion we want to reload its posts from
// scratch so that we have the most up-to-date data. Also, if we were
// to leave them in the store, the stream would try and render them
// which has the potential to be slow.
this.store.unloadAll('post');
// When we know we have the post IDs, we can set up the post stream with
// them. Then we will tell the view that we have finished loading so that
// it can scroll down to the appropriate post.