BigW Consortium Gitlab

profile.js.coffee 928 Bytes
Newer Older
1 2 3 4 5
$ ->
  $('.edit_user .application-theme input, .edit_user .code-preview-theme input').click ->
    # Submit the form
    $('.edit_user').submit()

6
    new Flash("Appearance settings saved", "notice")
7 8 9 10 11 12 13

  $('.update-username form').on 'ajax:before', ->
    $('.loading-gif').show()
    $(this).find('.update-success').hide()
    $(this).find('.update-failed').hide()

  $('.update-username form').on 'ajax:complete', ->
14
    $(this).find('.btn-save').enableButton()
15
    $(this).find('.loading-gif').hide()
16

17 18
  $('.update-notifications').on 'ajax:complete', ->
    $(this).find('.btn-save').enableButton()
19 20 21 22 23 24 25 26 27 28


  $('.js-choose-user-avatar-button').bind "click", ->
    form = $(this).closest("form")
    form.find(".js-user-avatar-input").click()

  $('.js-user-avatar-input').bind "change", ->
    form = $(this).closest("form")
    filename = $(this).val().replace(/^.*[\\\/]/, '')
    form.find(".js-avatar-filename").text(filename)