mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
make dropdowns toggle when clicked (for mobile)
This commit is contained in:
parent
561fc8cf2a
commit
5a33c1b96e
4
js/bootstrap-dropdown.js
vendored
4
js/bootstrap-dropdown.js
vendored
@ -38,12 +38,14 @@
|
||||
var $this = $(this)
|
||||
, selector = $this.attr('data-target') || $this.attr('href')
|
||||
, $parent = $(selector)
|
||||
, isActive
|
||||
|
||||
$parent.length || ($parent = $this.parent())
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
!$parent.hasClass('open') && $parent.toggleClass('open')
|
||||
!isActive && $parent.toggleClass('open')
|
||||
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user