MattMcFarland / com.mattmcfarland.fontawesome

Font Awesome meets Appcelerator Titanium Alloy
GNU General Public License v2.0
78 stars 23 forks source link

Changing icon on button click #22

Open bradsapp opened 9 years ago

bradsapp commented 9 years ago

I have not been successful in changing fa icons on click. Can anyone help me determine how I can change the icons for the buttons in the table rows?

$.table.addEventListener('click',function(e){
    if(e.source.toString() == '[object TiUIButton]') {
        if(e.source.icon=='fa-star-o') {
            $.fa.change(e.source,'fa-star');
        }
        if(e.source.icon=='fa-star') {
            $.fa.change(e.source,'fa-star-o');
        }
    }
});
MattMcFarland commented 9 years ago

can you confirm that e.source.icon is not undefined?