alloy.widget.iconicfont icon indicating copy to clipboard operation
alloy.widget.iconicfont copied to clipboard

addEventListener doesn't work.

Open kratsg opened this issue 11 years ago • 1 comments

<Widget class="icon" id="test" icon="icon-facebook" src="be.k0suke.fontawesome" />

$.test.addEventListener('click',function(){alert('test');});

However, the fireEvent works just fine

$.test.fireEvent('test');

Secondary issue is that you can't use the selectedColor property (so you can get an icon to sort of act like a button.

Third issue is that inserting the widget inside a button like

<Button>
  <Widget />
</Button>

creates a top padding above the widget.

kratsg avatar Oct 04 '13 04:10 kratsg

1, Try this code.

<Widget class="icon" id="test" icon="icon-facebook" src="be.k0suke.fontawesome" />

$.test.getView().addEventListener('click',function(){alert('test');});
$.test.getView().fireEvent('test');

2 and 3, This widget is Ti.UI.Label. So if you want to use the title of the Ti.UI.Button, then use the library here. This library to return the character code of icon.

k0sukey avatar Oct 05 '13 06:10 k0sukey