gitlab-org--gitlab-foss/app/assets/javascripts/behaviors/details_behavior.coffee
Dmitriy Zaporozhets 7157f79caa
Refactor js behaviours helpers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-11 15:15:08 +02:00

15 lines
416 B
CoffeeScript

$ ->
$("body").on "click", ".js-details-target", ->
container = $(@).closest(".js-details-container")
container.toggleClass("open")
# Show details content. Hides link after click.
#
# %div
# %a.js-details-expand
# %div.js-details-content
#
$("body").on "click", ".js-details-expand", (e) ->
$(@).next('.js-details-content').removeClass("hide")
$(@).hide()
e.preventDefault()