aboutsummaryrefslogtreecommitdiff
path: root/mod/messageboard/views/default
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-28 02:16:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-28 02:16:32 +0000
commitcbae343867676a78808ccdbd303c3c8bc4984cc1 (patch)
treefaa98494867a8cfd04cd683d8eedea36fb148afa /mod/messageboard/views/default
parent4cfe2dea1cd8e15db2500163bd62476d8cd9bc42 (diff)
downloadelgg-cbae343867676a78808ccdbd303c3c8bc4984cc1.tar.gz
elgg-cbae343867676a78808ccdbd303c3c8bc4984cc1.tar.bz2
Fixed a problem with the ajax for deleting message board posts.
git-svn-id: http://code.elgg.org/elgg/trunk@9041 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/messageboard/views/default')
-rw-r--r--mod/messageboard/views/default/messageboard/js.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/mod/messageboard/views/default/messageboard/js.php b/mod/messageboard/views/default/messageboard/js.php
index 131c96c8a..5d89fcd69 100644
--- a/mod/messageboard/views/default/messageboard/js.php
+++ b/mod/messageboard/views/default/messageboard/js.php
@@ -1,16 +1,18 @@
-
+//<script>
elgg.provide('elgg.messageboard');
elgg.messageboard.init = function() {
var form = $('form[name=elgg-messageboard]');
form.find('input[type=submit]').live('click', elgg.messageboard.submit);
- // can't undelete because of init load order
- form.parent().find('a.elgg-requires-confirmation').removeClass('elgg-requires-confirmation');
- // delegate() instead of live() because live() has to be at the top level of chains...can't use parent().
+ // remove the default binding for confirmation since we're doing extra stuff.
+ // @todo remove if we add a hook to the requires confirmation callback
+ form.parent().find('a.elgg-requires-confirmation')
+ .click(elgg.messageboard.deletePost)
- // delete is a little-known operator in JS. IE loses its mind if you name a method that.
- form.parent().delegate('.elgg-button-delete a', 'click', elgg.messageboard.deletePost);
+ // double whammy for in case the load order changes.
+ .unbind('click', elgg.ui.requiresConfirmation)
+ .removeClass('elgg-requires-confirmation');
}
elgg.messageboard.submit = function(e) {