Commit 5a33c1b9 authored by Jacob Thornton's avatar Jacob Thornton
Browse files

make dropdowns toggle when clicked (for mobile)

parent 561fc8cf
Showing with 3 additions and 1 deletion
+3 -1
...@@ -38,12 +38,14 @@ ...@@ -38,12 +38,14 @@
var $this = $(this) var $this = $(this)
, selector = $this.attr('data-target') || $this.attr('href') , selector = $this.attr('data-target') || $this.attr('href')
, $parent = $(selector) , $parent = $(selector)
, isActive
$parent.length || ($parent = $this.parent()) $parent.length || ($parent = $this.parent())
isActive = $parent.hasClass('open')
clearMenus() clearMenus()
!$parent.hasClass('open') && $parent.toggleClass('open') !isActive && $parent.toggleClass('open')
return false return false
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment