admin.js.coffee 1.1 KB
Newer Older
C
Ciro Santilli 已提交
1
class @Admin
2
  constructor: ->
3 4
    $('input#user_force_random_password').on 'change', (elem) ->
      elems = $('#user_password, #user_password_confirmation')
N
Nihad Abbasov 已提交
5

6 7 8 9
      if $(@).attr 'checked'
        elems.val('').attr 'disabled', true
      else
        elems.removeAttr 'disabled'
R
randx 已提交
10

11 12
    $('body').on 'click', '.js-toggle-colors-link', (e) ->
      e.preventDefault()
13
      $('.js-toggle-colors-container').toggle()
14

15 16 17
    $('.log-tabs a').click (e) ->
      e.preventDefault()
      $(this).tab('show')
D
Dmitriy Zaporozhets 已提交
18

19 20
    $('.log-bottom').click (e) ->
      e.preventDefault()
21
      visible_log = $(".file-content:visible")
22 23 24 25
      visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")

    modal = $('.change-owner-holder')

26 27
    $('.change-owner-link').bind "click", (e) ->
      e.preventDefault()
28 29
      $(this).hide()
      modal.show()
30

31 32
    $('.change-owner-cancel-link').bind "click", (e) ->
      e.preventDefault()
33 34
      modal.hide()
      $('.change-owner-link').show()
35

36
    $('li.project_member').bind 'ajax:success', ->
37 38
      Turbolinks.visit(location.href)

39
    $('li.group_member').bind 'ajax:success', ->
40
      Turbolinks.visit(location.href)