Skip to content

Commit

Permalink
Fixes to redirection and Edit#save
Browse files Browse the repository at this point in the history
  • Loading branch information
bnolan committed Nov 23, 2010
1 parent ed0972f commit 648e89a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
15 changes: 9 additions & 6 deletions application.coffee
Expand Up @@ -16,7 +16,10 @@ app =

redirectTo: (page) ->
$.mobile.changePage page


goBack: ->
history.back()


#
# Venue class
Expand Down Expand Up @@ -107,15 +110,15 @@ class EditVenueView extends Backbone.View

onSubmit: (e) ->
@model.set {
name : $("input[name='name']").val(),
address : $("input[name='address']").val(),
city : $("input[name='city']").val(),
state : $("input[name='state']").val()
name : @$("input[name='name']").val(),
address : @$("input[name='address']").val(),
city : @$("input[name='city']").val(),
state : @$("input[name='state']").val()
}

@model.trigger('change')

app.redirectTo "#venues-#{@model.cid}"
app.goBack()

e.preventDefault()
e.stopPropagation()
Expand Down
13 changes: 8 additions & 5 deletions application.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions index.html
@@ -1,6 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<!--
Source at https://github.com/bnolan/backbone-mobile
-->
<title>Backbone Mobile</title>
<meta name="viewport" content="width=default-width; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
Expand Down

0 comments on commit 648e89a

Please sign in to comment.