summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/details/commentform.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/lib/views/details/commentform.js')
-rw-r--r--public/assets/js/lib/views/details/commentform.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/public/assets/js/lib/views/details/commentform.js b/public/assets/js/lib/views/details/commentform.js
index 7f04ec3..d4a9149 100644
--- a/public/assets/js/lib/views/details/commentform.js
+++ b/public/assets/js/lib/views/details/commentform.js
@@ -10,8 +10,8 @@ var CommentForm = FormView.extend({
action: "",
- initialize: function(){
- this.__super__.initialize.call(this)
+ initialize: function(opt){
+ this.__super__.initialize.call(this, opt)
this.template = this.$(".template").html()
this.$comment = this.$("[name=comment]")
},
@@ -48,9 +48,12 @@ var CommentForm = FormView.extend({
return errors.length ? errors : null
},
- success: function(){
+ success: function(data){
$("[name=comment").val('')
$("[name=files").val('')
- window.location.reload()
+ // window.location.reload()
+ console.log(this)
+ console.log(this.parent)
+ this.parent.comments.load([data.comment])
}
})