I have an ember view, called picker, which is responsible for detecting click and mouseMove events on a div. Those events, when detected, send the respective calls to the corresponding controller.
export default Ember.View.extend({
templateName: 'picker',
click: function (event) {
this.get('controller').send('addColor', event);
},
mouseMove: function (event) {
this.get('controller').send('updateColor', event);
}
});
My app requires that I perform some logic using the pageX and pageY properties of the event object and also determine some scaling factors using the properties of the div (offset, width, height etc.).
Where should that work be done? Should it all be contained within the view and just passed through to the action methods as parameters or should I pass the event object through and make it a responsibility of the controller? My gut says the former...