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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user