diff options
| author | julian laplace <julescarbon@gmail.com> | 2022-10-28 13:47:06 +0200 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2022-10-28 13:47:06 +0200 |
| commit | b39de8cc12c83029168f311a7d3e4ddd96d52635 (patch) | |
| tree | 0aa3f141e050187821e82f787f37a30e9157ea62 /public/assets/js/lib/views/details/details.js | |
| parent | 02bb7181aca0298dbc8b29ba0aeac3e07f643930 (diff) | |
toggle form
Diffstat (limited to 'public/assets/js/lib/views/details/details.js')
| -rw-r--r-- | public/assets/js/lib/views/details/details.js | 11 |
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); + }, }); |
