gitlab-org--gitlab-foss/app/assets/javascripts/admin.js.coffee

54 lines
1.7 KiB
CoffeeScript
Raw Normal View History

2014-10-20 16:48:07 -04:00
class @Admin
constructor: ->
$('input#user_force_random_password').on 'change', (elem) ->
elems = $('#user_password, #user_password_confirmation')
2012-09-06 07:32:01 -04:00
if $(@).attr 'checked'
elems.val('').attr 'disabled', true
else
elems.removeAttr 'disabled'
2012-09-11 16:24:53 -04:00
$('body').on 'click', '.js-toggle-colors-link', (e) ->
e.preventDefault()
$('.js-toggle-colors-container').toggle()
$('input#broadcast_message_color').on 'input', ->
previewColor = $(@).val()
$('div.broadcast-message-preview').css('background-color', previewColor)
$('input#broadcast_message_font').on 'input', ->
previewColor = $(@).val()
$('div.broadcast-message-preview').css('color', previewColor)
$('textarea#broadcast_message_message').on 'input', ->
previewMessage = $(@).val()
previewMessage = "Your message here" if previewMessage.trim() == ''
$('div.broadcast-message-preview span').text(previewMessage)
$('.log-tabs a').click (e) ->
e.preventDefault()
$(this).tab('show')
2012-11-28 23:49:11 -05:00
$('.log-bottom').click (e) ->
e.preventDefault()
visible_log = $(".file-content:visible")
visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
modal = $('.change-owner-holder')
$('.change-owner-link').bind "click", (e) ->
e.preventDefault()
$(this).hide()
modal.show()
$('.change-owner-cancel-link').bind "click", (e) ->
e.preventDefault()
modal.hide()
$('.change-owner-link').show()
$('li.project_member').bind 'ajax:success', ->
Turbolinks.visit(location.href)
$('li.group_member').bind 'ajax:success', ->
Turbolinks.visit(location.href)