move jQuery code for comment actions from page template to moderation.js.

svn path=/plone.app.discussion/trunk/; revision=27721
This commit is contained in:
Timo Stollenwerk
2009-06-29 13:39:55 +00:00
parent 502015b14e
commit 2bc25c06de
2 changed files with 17 additions and 19 deletions
@@ -16,6 +16,23 @@ jq(document).ready(function() {
}
});
/*****************************************************************
* Comment actions (delete, publish)
*****************************************************************/
jq('form.background-form').submit(function(e) {
e.preventDefault();
var target = jq(this).attr('action');
var params = jq(this).serialize();
var cell = jq(this).parent().get(0);
var row = jq(cell).parent().get(0);
jq.post(target, params, function(data) {
jq(row).fadeOut("normal", function() {
jq(this).remove();
});
});
});
/*****************************************************************
* Bulk actions
*****************************************************************/