Skip to content

Instantly share code, notes, and snippets.

@mbriggs
Created August 18, 2011 00:59
Show Gist options
  • Save mbriggs/1153042 to your computer and use it in GitHub Desktop.
Save mbriggs/1153042 to your computer and use it in GitHub Desktop.
// most of render()
this.el.html(this.template())
this.$('input[name=id]').val(this.endpoint.get('id'))
this.$('input[name=group]').val(this.endpoint.get('group'))
this.$('input[name=name]').val(this.endpoint.get('name'))
this.$('input[name=route]').val(this.endpoint.get('route'))
this.$('textarea[name=sample_xml]').val(this.endpoint.get('sample_xml'))
// buildEndpoint(), factory function to assemble an endpoint off of the form
buildEndpoint: function(attrs) {
var endpoint = null
if (attrs.id == "") delete attrs.id // ugh
if (attrs.id) {
endpoint = edi.endpoints.get(attrs.id)
endpoint.set(attrs)
} else {
endpoint = new Endpoint(attrs)
}
return endpoint
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment