 # Username settings
 Template.settingsUsername.events =
   'submit form#set-username': (event, template) ->
-    event.stopPropagation()
     event.preventDefault()
-    usernameReadyForValidation = true
     usernameFormMessages.resetMessages()
     username = $('#username').val()
     try

    return # Make sure CoffeeScript does not return anything

  'blur input#username': (event, template) ->
    event.stopPropagation()
    usernameReadyForValidation = usernameFieldModified
    username = $('#username').val()
    validateUsername username, 'username'

    return # Make sure CoffeeScript does not return anything

Template.settings.usernameExists = ->
  !!Meteor.person?().user?.username

Template.settingsUsername.messageOnField = (field, options) ->
  field = null unless options
