Welcome to mirror list, hosted at ThFree Co, Russian Federation.

toggler_behavior.coffee « behaviors « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 177b6918270dcc1a58851fc46f10dcb5aae2f06e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ ->
  # Toggle button. Show/hide content inside parent container.
  # Button does not change visibility. If button has icon - it changes chevron style.
  #
  # %div.js-toggle-container
  #   %a.js-toggle-button
  #   %div.js-toggle-content
  #
  $("body").on "click", ".js-toggle-button", (e) ->
    $(@).find('i').
      toggleClass('fa fa-chevron-down').
      toggleClass('fa fa-chevron-up')
    $(@).closest(".js-toggle-container").find(".js-toggle-content").toggle()
    e.preventDefault()