summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/details/details.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/lib/views/details/details.js')
-rw-r--r--public/assets/js/lib/views/details/details.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/details/details.js b/public/assets/js/lib/views/details/details.js
index 465655b..c1e7bf6 100644
--- a/public/assets/js/lib/views/details/details.js
+++ b/public/assets/js/lib/views/details/details.js
@@ -8,7 +8,10 @@ var DetailsView = View.extend({
this.comments = new CommentsView({ parent: this });
this.files = new FilesView({ parent: this });
this.gallery = new GalleryView({ parent: this });
- this.form = new CommentForm({ parent: this });
+ this.form = new CommentForm({
+ parent: this,
+ onSubmit: this.onSubmit.bind(this),
+ });
this.threadbox = new ThreadBox({ parent: this });
this.settings = new ThreadSettingsForm({ parent: this });
$(".settings_link").click(this.openSettings.bind(this));
@@ -63,4 +66,10 @@ var DetailsView = View.extend({
e && e.preventDefault();
this.settings.show();
},
+
+ onSubmit: function (data) {
+ data.comment && this.comments.load([data.comment]);
+ data.files && this.files.add(data.files);
+ data.files && this.gallery.add(data.files);
+ },
});