debian-mirror-gitlab/app/assets/javascripts/behaviors/details_behavior.coffee

16 lines
416 B
CoffeeScript
Raw Normal View History

2014-09-02 18:07:02 +05:30
$ ->
$("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()