Skip to content

enable bubbling of the events scrollSpy:enter and scrollSpy:exit#10

Open
Mithgol wants to merge 2 commits into
thesmart:masterfrom
Mithgol:bubble
Open

enable bubbling of the events scrollSpy:enter and scrollSpy:exit#10
Mithgol wants to merge 2 commits into
thesmart:masterfrom
Mithgol:bubble

Conversation

@Mithgol
Copy link
Copy Markdown
Contributor

@Mithgol Mithgol commented Jul 16, 2014

Currently the events triggered by ScrollSpy do not bubble because they are triggered by the jQuery's .triggerHandler method which (according to the docs) is similar to .trigger() but one of the exceptions is the following:

Events triggered with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.

Unfortunately, for me it's an issue. Sometimes in my applications (PhiDo, for example) I have to initiate scrollspying on hundreds of elements. Installing a separate event handler on each of these elements (instead of only one handler on a parent element) seems superfluous.

Hence a pull request to replace .triggerHandler with a simple .trigger.

(Also fixes #8 because is based on its code branch.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant