Skip to content
This repository was archived by the owner on Jun 12, 2026. It is now read-only.

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

@Mithgol Mithgol commented Jul 16, 2014

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant