admin.js.coffee 866 字节
Newer Older
1 2
class Admin
  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 13
    $('.log-tabs a').click (e) ->
      e.preventDefault()
      $(this).tab('show')
D
Dmitriy Zaporozhets 已提交
14

15 16
    $('.log-bottom').click (e) ->
      e.preventDefault()
17
      visible_log = $(".file-content:visible")
18 19 20 21
      visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")

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

22 23
    $('.change-owner-link').bind "click", (e) ->
      e.preventDefault()
24 25 26
      $(this).hide()
      modal.show()
    
27 28
    $('.change-owner-cancel-link').bind "click", (e) ->
      e.preventDefault()
29 30
      modal.hide()
      $('.change-owner-link').show()
31 32

@Admin = Admin