Replacing the text with a basic img tag has the same effect; when clicked, the activity item is deleted but on a page reload instead of via ajax.
So I don’t think it’s specific to font awesome.
This issue gets stranger the farther I dig…
1. We aren’t using the BP Default theme, so why is the activity stream using global.js instead of buddypress.js from the legacy theme?
2. in either /js, this click handler is never triggered if an image is used in the < a > tag for activity->delete or activity->fav
jq('div.activity').click( function(event) {
It’s the jquery in global.js
The ‘target’ becomes the icon rather than the a tag.
So if ( target.hasClass('delete-activity')
fails.
Changing to this gets the right target:
if ( target.hasClass('icon-trash') {
And then you need to change:
var link_href = target.attr('href');
to:
var link_href = target.closest("a").attr("href");
otherwise the nonce won’t be found and the ajax will fail.
Note: why is global.js being loaded from BuddyPress Default Theme when BP Legacy Theme is being used? Don’t know, but something is funky in this particular client’s installation.
I ran into the same problem and by the time I found this post I had tried various js click pass-throughs and it was getting ugly.
Here is a css-only approach to fix font-awesome and other a.button conflicts of that nature.
a.button * { pointer-events:none; }
Since anchors are almost always the click targets for a user pointer perspective, it makes no sense that any thing within the anchor would catch pointer interactions.
If you’re a genius and created a design that uses nested link elements you could further specialize the selector a.button :not(a):not(button)
… Not recommended at all though!