0

I have several buttons that trigger correctly even after packaging, and they are being declared in the exact same way. The only apparent change this button has is that it is placed within a modal.

The listeners are being correctly initialized, I can trigger it by doing (getbutton).fireEvent('tap').

The element is correctly on top of all other elements, when I inspect it in devtools, it is the topmost element.
The buttons work correctly before packaging, and I tried with both the base Ext.Button class and my custom button class, neither work after packaging.

Here is a screenshot of the buttons:

Buttons

Some relevant code

Button Declaration:

{
 xtype:   'iconButton'
 iconCls: 'fa fa-close'
 listeners: tap:->
   @rootView ?= @up('imageEditor')
   @rootView.cancel()
}

xtype:'button' doesn't trigger the handler either. And xtype:'button' with handler:-> doesn't trigger it either.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • Where did you define @rootView (looks like you are using a second library or framework here.) There are no comma, the listeners definition would not work to me. And where did you define iconButton. Can you show that too? And why aren't you using handler instead of listeners? – Dinkheller Sep 23 '14 at 19:05
  • I found the origin of the problem. It was that the view was a singleton, and event handlers are not registered on singletons when the package is built(probably a bug). By removing the singleton statement and creating the view with Ext.create, they are correctly bound and it works as expected. The reason there are no commas and there is an @rootView is because that is Coffeescript. – Johnydays Sep 25 '14 at 13:00
  • Coffeescript. Interesting. – Dinkheller Sep 25 '14 at 13:23

0 Answers0