diff options
| -rw-r--r-- | bucky/app/api.js | 3 | ||||
| -rw-r--r-- | bucky/app/bucky.js | 1 | ||||
| -rw-r--r-- | public/assets/js/lib/views/details/commentform.js | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/bucky/app/api.js b/bucky/app/api.js index 744d675..b4231e7 100644 --- a/bucky/app/api.js +++ b/bucky/app/api.js @@ -168,7 +168,8 @@ function route (app){ bucky.bumpThreadRevisions, function(req, res){ res.json({ - comment: res.comment + comment: res.comment, + files: res.files, }) }) app.get("/api/comment/:id", diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js index 70cfeec..3824c5e 100644 --- a/bucky/app/bucky.js +++ b/bucky/app/bucky.js @@ -511,6 +511,7 @@ var bucky = module.exports = { }) }) Promise.all(promises).then(values => { + res.files = values next() }).catch(err => { console.log(err) diff --git a/public/assets/js/lib/views/details/commentform.js b/public/assets/js/lib/views/details/commentform.js index d4a9149..2b76171 100644 --- a/public/assets/js/lib/views/details/commentform.js +++ b/public/assets/js/lib/views/details/commentform.js @@ -54,6 +54,9 @@ var CommentForm = FormView.extend({ // window.location.reload() console.log(this) console.log(this.parent) - this.parent.comments.load([data.comment]) + console.log(data) + data.comment && this.parent.comments.load([data.comment]) + data.files && this.parent.files.load(data.files) + data.files && this.parent.gallery.load(data.files) } }) |
