Created
March 29, 2011 01:24
-
-
Save scottharvey/891661 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
render: function() { | |
// Initialize the template | |
if (this.template == null) { this.template = Haml($('#task_template').html()); } | |
// Update the template based on the model's attributes | |
$(this.el).html(this.template(this.model.viewAttributes())); | |
// Insert the template into the DOM if it doesn't already exist | |
if ($('#' + this.id).length == 0) { | |
$(this.model.milestone.view.el).after(this.el); | |
} | |
return this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment