]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
clicking open dropdown shoud close it
authorJacob Thornton <jacobthornton@gmail.com>
Sun, 11 Sep 2011 05:28:17 +0000 (22:28 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Sun, 11 Sep 2011 05:28:17 +0000 (22:28 -0700)
js/bootstrap-dropdown.js

index 26db8546115a24404107af30b67f6739d2f870d6..8be8f13c064d09ef9680441d8f74c6cd86a72ae9 100644 (file)
   $.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
       })
     })