Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into skill-meters
  • Loading branch information
jannypie committed Apr 20, 2015
2 parents af76112 + 902f026 commit b346ae1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ class App.Views.Users.Edit extends App.View
@$el.html(@template(@model.attributes))

onFormSubmit: ->
$('#get_api').attr('disabled', true)
$('#get_api').val('Loading...')
form = @$el.find "form"
newAttrs = form.serializeJSON()
success = =>
console.log @model
gh_handle = @model.get('github_handle')
window.getGitHubData(gh_handle) if gh_handle
App.router.navigate("/#{@model.get('username')}", {trigger: true});
error = -> $('.message').html("<span class='error'>There was an issue saving your updates</span>")
error = ->
$('#get_api').attr('disabled', false)
$('#get_api').val('Submit')
$('.message').html("<span class='error'>There was an issue saving your updates</span>")
@model.save(newAttrs, success: success, error: error)
false

0 comments on commit b346ae1

Please sign in to comment.