I have the following kind of element:
return Marionette.ItemView.extend({
template:tpl,
tagName: 'div',
className: 'v_itv_record_type_item',
events:{
'click @ui.item':'itemClicked'
},
ui:{
item:'.v_itv_record_type_item'
},
itemClicked:function(e){
console.log('clicked');
}
});
which uses the following handlebars pattern:
<div class="clicktarget">
Stuff Goes Here
</div>
If you click on one of these types of elements, it will not register the click event. I understand that Backbone restricts access only to a fragment of DOM representations, but apparently this does not apply to the containing div itself, even if the containing div is not part of any template, parent view, or otherwise.
If we change the hash file ui and the point element in .clicktarget, a click will be registered. But that gives me the structure <div><div>stuff goes here</div></div>, apparently for no reason. Is this the only way to detect a click on the entire DOM element of the view elements?