aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
blob: 4f587d2d58cc8668479216fe5681d21414020a98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var eventTypes = ['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'mousemove'].forEach(function(e) {
  // add event to SVG.Elment
  SVG.Element.prototype[e] = function(f) {
    var s = this;

    // bind event to element rather than element node
    this.node['on' + e] = function() {
      return f.apply(s, arguments);
    };

    // return self
    return this;
  };
});