Fixes removing the namespace from an event name #2115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bootstrap uses events which need to include a namespace. E.g. the event name to bind to showing a modal is
show.bs.modal
. Just setting the event onshow
will not work.Example:
The issue when using jquery-UI's
_on
method is that the namespace gets cut off. So this will not work:The issue is the regex in the
_on
method. It does not allow a dot in the event name and also it searches for zero to unlimited amount of spaces to split of the selector.This results into the following:
To prevent this I changed the regex to also allow dots so namespaces will not be broken apart and also to require at least one whitespace.