diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-09-22 20:51:46 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-09-22 20:51:46 +0200 |
commit | dd190c872b05e3d0d502235cbea089a7766e4177 (patch) | |
tree | 0c52c86e3ebb0fc564064dec6d2e963922c833dd /spec | |
parent | 9fce07dc8c2e4772051c6944849d32420496a261 (diff) | |
download | svg.js-dd190c872b05e3d0d502235cbea089a7766e4177.tar.gz svg.js-dd190c872b05e3d0d502235cbea089a7766e4177.zip |
Added custom context binding for event callbacks
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/event.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/spec/event.js b/spec/spec/event.js index 678c7b9..9c945d0 100644 --- a/spec/spec/event.js +++ b/spec/spec/event.js @@ -332,6 +332,10 @@ describe('Event', function() { dispatchEvent(rect.on('event', action), 'event') expect(context).toBe(rect) }) + it('applies given object as context', function() { + dispatchEvent(rect.on('event', action, this), 'event') + expect(context).toBe(this) + }) it('stores the listener for future reference', function() { rect.on('event', action) expect(SVG.listeners[SVG.handlerMap.indexOf(rect.node)]['event']['*'][action]).not.toBeUndefined() |