-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Forward originalEvent to hide.bs.dropdown handlers #11373
Conversation
@@ -90,12 +90,14 @@ | |||
$items.eq(index).focus() | |||
} | |||
|
|||
function clearMenus() { | |||
function clearMenus(ev) { |
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.
Presumably the call to clearMenus()
within toggle()
should pass along its event object?
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.
Correct me if I'm wrong but toggle
is supposed to be called programmatically so I don't see what event could be bound to it !?
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.
toggle is bound to the dropdown's click event, and is invoked when you click a dropdown to show/hide its menu.
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.
My bad ! I applied the same principle to all custom events triggered by dropdown. I also used sourceEvent
instead of originalEvent
in order to avoid to hoist the jQuery semantic on originalEvent. If you prefer another name than sourceEvent
just tell me.
Also, documentation should be added for this. |
Renamed originalEvent to sourceEvent
After having a look at the jQuery mouseenter event I could see that originalEvent is not necessary the same as the current event. So it make sense to use the same convention as jQuery.
Ok, the events triggered by dropdown are now consistent and the documentation has been updated as a more advanced code example. As English is not my native language you'd better check the wording. |
Bumping this pull request. |
For consistency with the modal events, we should probably just pass the target of the original event as |
Anyway, due to versioning constraints, we can't merge this until Bootstrap v3.1, so expect to wait a while. |
Shall I do something about this ? I don't know what this "closed with unmerged commits" message means. |
* upstream/master: (119 commits) Drop trailling comma New Year fix assets links in all examples Update Gruntfile.js to copy 'dist/' files to 'docs/dist/' with 'grunt dist' task; Fixes twbs#12030: navbar toggle focus state Fix broken JS derp Fixes twbs#12046: move .csscomb.json and .csslintrc to less/ folder typo @nschonni's feedback <3 @cvrebert's feedback Update dependencies (again) Fixed typo Sauce now supports latest Firefox on OS X Mavericks default to latest Firefox version on OS X fix capitalization of iOS mv sauce_browsers.yml out of the project root add note about ios dropdown compat fixes twbs#11379 - Fix carousel this.sliding not getting reset if $next.hasClass('active') fixes twbs#11373 - adds related target to dropdown events fixes twbs#11288 - Vertical scroll position of modal saves between openings ... Conflicts: Gruntfile.js dist/css/bootstrap-theme.css dist/css/bootstrap-theme.css.map dist/css/bootstrap-theme.min.css dist/css/bootstrap.css dist/css/bootstrap.css.map dist/css/bootstrap.min.css dist/js/bootstrap.js dist/js/bootstrap.min.js docs/assets/css/docs.css docs/assets/css/pygments-manni.css docs/assets/ico/apple-touch-icon-144-precomposed.png docs/assets/js/application.js docs/assets/js/customize.js docs/assets/js/customizer.js docs/assets/js/filesaver.js docs/assets/js/holder.js docs/assets/js/ie8-responsive-file-warning.js docs/assets/js/jszip.js docs/assets/js/less.js docs/assets/js/raw-files.js docs/assets/js/uglify.js test-infra/s3_cache.py
One might be interested to check the original event that originally triggered the dropdown's custom event.
In my case I need the target of the original click event in order to decide if I preventDefault or not.