Skip to content

Instantly share code, notes, and snippets.

@justinvdm
Created August 15, 2012 00:42
Show Gist options
  • Save justinvdm/3354281 to your computer and use it in GitHub Desktop.
Save justinvdm/3354281 to your computer and use it in GitHub Desktop.
render: function() {
this.$el.html("<input name='' class='check' type='checkbox'/>");
var title=this.model.get("title");
var shortTitle=title;
if (title.length>20){
shortTitle=title.substring(0,20)+"...";
}
var stitle=slugify(title);
this.$el.append("<span id='" + stitle + "'class='title' value='"+title+"'>" + shortTitle + "</span>");
if (this.model.get("selected")) {
$("#" + stitle).css("color", this.model.get("color"));
} else {
$("#" + stitle).css("color", "#000");
}
this.$(".check").attr("checked", this.model.get("selected"));
$('.title').tipsy({
gravity: $.fn.tipsy.autoWE,
fade: true,
title: 'value'
});
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment