Created
August 18, 2011 00:59
-
-
Save mbriggs/1153042 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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