fix remove comment button in the comments viewlet.
svn path=/plone.app.discussion/trunk/; revision=27815
This commit is contained in:
parent
e2934a66b1
commit
0c377e3c9b
@ -101,7 +101,8 @@
|
||||
style="display: inline;"
|
||||
tal:condition="view/can_manage"
|
||||
tal:attributes="action string:${reply/absolute_url}/@@moderate-delete-comment">
|
||||
<input class="destructive"
|
||||
<input name="form.button.DeleteComment"
|
||||
class="destructive"
|
||||
type="submit"
|
||||
value="Remove"
|
||||
i18n:attributes="value label_remove;"
|
||||
|
@ -77,4 +77,26 @@ jq(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
/*****************************************************************
|
||||
* Remove comment.
|
||||
*****************************************************************/
|
||||
jq("input[name='form.button.DeleteComment']").click(function(e){
|
||||
e.preventDefault();
|
||||
var form = jq(this).parent();
|
||||
var target = jq(form).attr("action");
|
||||
var comment = jq(form).parent()
|
||||
jq.ajax({
|
||||
type: "GET",
|
||||
url: target,
|
||||
success: function(msg){
|
||||
// fade out row
|
||||
jq(comment).fadeOut("normal", function(){
|
||||
jq(this).remove();
|
||||
});
|
||||
},
|
||||
error: function(msg){
|
||||
alert("Error sending AJAX request:" + target);
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user