public
Created

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// 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
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.