2013-05-02 07:51:47 -04:00
|
|
|
class Admin
|
|
|
|
constructor: ->
|
2013-05-02 04:46:45 -04:00
|
|
|
$('input#user_force_random_password').on 'change', (elem) ->
|
|
|
|
elems = $('#user_password, #user_password_confirmation')
|
2012-09-06 07:32:01 -04:00
|
|
|
|
2013-05-02 04:46:45 -04:00
|
|
|
if $(@).attr 'checked'
|
|
|
|
elems.val('').attr 'disabled', true
|
|
|
|
else
|
|
|
|
elems.removeAttr 'disabled'
|
2012-09-11 16:24:53 -04:00
|
|
|
|
2013-05-02 04:46:45 -04:00
|
|
|
$('.log-tabs a').click (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
$(this).tab('show')
|
2012-11-28 23:49:11 -05:00
|
|
|
|
2013-05-02 04:46:45 -04:00
|
|
|
$('.log-bottom').click (e) ->
|
|
|
|
e.preventDefault()
|
2013-07-13 02:52:47 -04:00
|
|
|
visible_log = $(".file-content:visible")
|
2013-05-02 04:46:45 -04:00
|
|
|
visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
|
|
|
|
|
|
|
|
modal = $('.change-owner-holder')
|
|
|
|
|
2013-06-10 08:58:51 -04:00
|
|
|
$('.change-owner-link').bind "click", (e) ->
|
|
|
|
e.preventDefault()
|
2013-05-02 04:46:45 -04:00
|
|
|
$(this).hide()
|
|
|
|
modal.show()
|
2013-08-27 14:35:41 -04:00
|
|
|
|
2013-06-10 08:58:51 -04:00
|
|
|
$('.change-owner-cancel-link').bind "click", (e) ->
|
|
|
|
e.preventDefault()
|
2013-05-02 04:46:45 -04:00
|
|
|
modal.hide()
|
|
|
|
$('.change-owner-link').show()
|
2013-05-02 07:51:47 -04:00
|
|
|
|
2013-08-27 14:35:41 -04:00
|
|
|
$('li.users_project').bind 'ajax:success', ->
|
|
|
|
Turbolinks.visit(location.href)
|
|
|
|
|
|
|
|
$('li.users_group').bind 'ajax:success', ->
|
|
|
|
Turbolinks.visit(location.href)
|
|
|
|
|
2013-05-02 07:51:47 -04:00
|
|
|
@Admin = Admin
|