1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 16:14:04 +02:00

clicking open dropdown shoud close it

This commit is contained in:
Jacob Thornton
2011-09-10 22:28:17 -07:00
parent 7e5b304dbf
commit 709789d16d

View File

@@ -36,8 +36,11 @@
$.fn.dropdown = function ( options ) {
return this.each(function () {
$(this).delegate(selector, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
$(this).parent('li').toggleClass('open')
!isActive && li.toggleClass('open')
return false
})
})