gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

fix add event handler not available and observables with different scope #758

Open mablesly opened 3 years ago

mablesly commented 3 years ago

The add event handler as described in the documentation is not available to the rest of the code as it is added to the field and not to the _events of the field object. As "onAdd" does not exist in the specs, this is ignored and the handler never called. Therefore "add" should be added in the if-clause and to end up in the _event handlers.

The functionality of observables from different scopes didn't work anymore. For some reason the scope of this was added to the arguments and later used as scope. This way the original scope was interpreted as ID of the element.