Friday, January 04, 2013

javascript - backbone.js & raphäel.js / Backbone View <-> Raphäel Object - Stack Overflow

javascript - backbone.js & raphäel.js / Backbone View <-> Raphäel Object - Stack Overflow: "It should work if you are really using DOM element. E.g. if you have a Raphael object circle, then the DOM element would be circle.node. That one you need to pass as "el" property in the options or make sure that View's this.el is actually Raphael object's "node" property.

If you want to bind event manually and want to be able to access the view in the event handler, use Underscore's bind function:

$(circle.node).click(_.bind(someHandlerFunction, this));
where this should point to the view object in current context. In that case, inside someHandlerFunction, this object would be the view."

'via Blog this'