mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-29 16:19:53 +02:00
clean up js api for dropdowns
This commit is contained in:
6
js/bootstrap-dropdown.js
vendored
6
js/bootstrap-dropdown.js
vendored
@@ -27,7 +27,10 @@
|
||||
|
||||
var toggle = '[data-toggle="dropdown"]'
|
||||
, Dropdown = function ( element ) {
|
||||
$(element).bind('click', this.toggle)
|
||||
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
||||
$('html').on('click.dropdown.data-api', function () {
|
||||
$el.parent().removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
Dropdown.prototype = {
|
||||
@@ -51,7 +54,6 @@
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
!isActive && $parent.toggleClass('open')
|
||||
|
||||
return false
|
||||
|
Reference in New Issue
Block a user