gitlab-org--gitlab-foss/app/assets/javascripts/behaviors/toggler_behavior.coffee
2013-08-06 18:45:45 +03:00

18 lines
590 B
CoffeeScript

$ ->
$("body").on "click", ".js-toggler-target", ->
container = $(@).closest(".js-toggler-container")
container.toggleClass("on")
$("body").on "click", ".js-toggle-visibility-link", (e) ->
$(@).find('i').
toggleClass('icon-chevron-down').
toggleClass('icon-chevron-up')
container = $(".js-toggle-visibility-container")
container.toggleClass("hide")
e.preventDefault()
$("body").on "click", ".js-toggle-button", (e) ->
$(@).disableButton()
$(@).closest(".js-toggle-container").find(".js-toggle-content").show()
e.preventDefault()