There are 4 handlebar helper blocks named
{{#decoy-Input class="fieldInput"}} {{/decoy-Input}}
and I'm trying to reference them all using Jquery by calling their class, 'fieldInput'
However, when I use
{{#decoy-Input class="fieldInput"}} {{/decoy-Input}}
, the fieldInput class is not recognized
I suspect this may be due to the order in which the views were rendered, but I would appreciate a second opinion
Below is the view that defines these blocks.
VpcYeoman.DecoyInputView = Ember.View.extend({
tagName: 'div',
click: function(e) {
console.log('CanFocusInputView clicked')
$('.fieldInput').removeClass('.focusedInput');
this.$().addClass('focusedInput');
},
});
Ember.Handlebars.helper('decoy-Input', VpcYeoman.DecoyInputView);
In order to achieve success, you need to find a way to access all 4 of the
{{#decoy-Input class="fieldInput"}} {{/decoy-Input}}
blocks within the Decoy Input click function without relying on JQuery.
I understand that something like '
this.$().parent().siblings('.objectInput').children().removeClass('focusedInput');
' could resolve the issue as well, but it seems like a suboptimal solution.