source/javascripts/refills/coffeescript/dropdown.coffee in refills-0.1.0 vs source/javascripts/refills/coffeescript/dropdown.coffee in refills-0.2.0
- old
+ new
@@ -1,15 +1,11 @@
$(document).ready ->
$(".dropdown-button").click ->
- $(".dropdown-menu").toggleClass "show-menu"
- $(".dropdown-menu > li").click ->
- $(".dropdown-menu").removeClass "show-menu"
+ $button = $(this)
+ $menu = $button.siblings(".dropdown-menu")
+ $menu.toggleClass "show-menu"
+ $menu.children("li").click ->
+ $menu.removeClass "show-menu"
+ $button.html $(this).html()
return
-
- $(".dropdown-menu.dropdown-select > li").click ->
- $(".dropdown-button").html $(this).html()
- return
-
return
-
return
-