Replace explicit FormXHR setup for a bunch of simple AJAX form submissions with adding the 'ajax' class on them.

This avoids having to add extra custom JS bits just to initialize forms using the common AJAX submission path.
This commit is contained in:
Brion Vibber
2011-03-08 13:58:28 -08:00
parent 90f1cfcfc0
commit 28809035d0
12 changed files with 19 additions and 43 deletions

View File

@@ -180,21 +180,6 @@ class UserFlagPlugin extends Plugin
}
}
/**
* Initialize any flagging buttons on the page
*
* @param Action $action action being shown
*
* @return boolean hook result
*/
function onEndShowScripts($action)
{
$action->inlineScript('if ($(".form_entity_flag").length > 0) { '.
'$(".form_entity_flag").bind("click", function() {'.
'SN.U.FormXHR($(this)); return false; }); }');
return true;
}
/**
* Check whether a user has one of our defined rights
*