-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal for #807, includes #550, SVG.off()
multiple events and option argument
#808
Conversation
…)` and add option argument
d6cb547
to
9569005
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It all looks good to me
expect(Object.keys(SVG.listeners[SVG.handlerMap.indexOf(rect3.node)]['event']['*']).length).toBe(2) // 2 listener on rect3 | ||
|
||
expect(SVG.listeners.length).toBe(listenerCnt + 3) // added listeners on 3 different elements | ||
expect(Object.keys(rect.events['event']['*']).length).toBe(1) // 1 listener on rect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats this star doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The star is a wildcard namespace. So every event not bound to a particular namespace will get saved under the wildcard namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, sounds fair to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe though, it should be clearer? Maybe something like 'default'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to take something which wouldnt be used by the user on accident
Go ahead and merge this and close its relevant issues if you're happy with it :) |
This PR is Work in Progress.
It moves the event handlers on the node as discussed in #807. It also changes #550 so that we now have
fire()
anddispatch()
as two seperate methods.Furthermore its now possible to remove multiple elements at once when calling
SVG.off()
. (Binding was already possible). It also adds the option argument toSVG.off()
which is needed there.I made this PR to see which changes are required to make the proposal work. Its not that much overhead to manage HTMLNodes.
Comments are welcome!