XF 2.3 Dynamically changing FA icons?

Jaxel

Well-known member
I have the following FA icon:
Code:
<xf:fa icon="fa-square" />

I want to change the icon when a link is clicked to fa-check-square. In previous versions of XF, I could simply change the class in JS. But this doesn't seem to work anymore. Is there a proper way to do this now?
 
I hope this link will be helpful

 
I solved it a different way...

Instead of putting the icons in <xf:fa /> html tags, I added a class to the div and put the fa icon in a css/less :before tag (ie: .check:before { .m-faContent(@fa-var-check-square); }. Then instead of dynamically changing the icons, I simply dynamically change the div class.
 
Back
Top Bottom