make dropdowns toggle when clicked (for mobile)

This commit is contained in:
Jacob Thornton 2012-01-08 14:19:53 -08:00
parent 561fc8cf2a
commit 5a33c1b96e
1 changed files with 3 additions and 1 deletions

View File

@ -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
}