diff options
author | wout <wout@impinc.co.uk> | 2013-03-09 22:28:47 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-03-09 22:28:47 +0100 |
commit | 6c6c82ed59533f44f8754b69d47e3b11cd6dd129 (patch) | |
tree | adaef53d8970acb228fe14d490c532f1baabbb13 /src/event.js | |
parent | 16c4a146ee97fa43e0c456fe801490351e551e96 (diff) | |
download | svg.js-6c6c82ed59533f44f8754b69d47e3b11cd6dd129.tar.gz svg.js-6c6c82ed59533f44f8754b69d47e3b11cd6dd129.zip |
Bumped to v0.9, added better style management, text support and extended animation functionality0.10
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/event.js b/src/event.js index df3cd6a..84022c7 100644 --- a/src/event.js +++ b/src/event.js @@ -3,28 +3,27 @@ // rect.click(function() { // this.fill({ color: '#f06' }) // }) -;[ 'click', - 'dblclick', - 'mousedown', - 'mouseup', - 'mouseover', - 'mouseout', - 'mousemove', - 'mouseenter', - 'mouseleave', - 'touchstart', - 'touchend', - 'touchmove', - 'touchcancel' ].forEach(function(event) { +;[ 'click' +, 'dblclick' +, 'mousedown' +, 'mouseup' +, 'mouseover' +, 'mouseout' +, 'mousemove' +, 'mouseenter' +, 'mouseleave' +, 'touchstart' +, 'touchend' +, 'touchmove' +, 'touchcancel' ].forEach(function(event) { /* add event to SVG.Element */ SVG.Element.prototype[event] = function(f) { var self = this /* bind event to element rather than element node */ - this.node['on' + event] = typeof f == 'function' - ? function() { return f.apply(self, arguments); } - : null + this.node['on' + event] = typeof f == 'function' ? + function() { return f.apply(self, arguments) } : null return this } @@ -54,11 +53,11 @@ SVG.extend(SVG.Element, { SVG.on(this.node, event, listener) return this - }, + } // Unbind event from listener - off: function(event, listener) { +, off: function(event, listener) { SVG.off(this.node, event, listener) return this } -});
\ No newline at end of file +})
\ No newline at end of file |