Created
August 15, 2012 00:42
-
-
Save justinvdm/3354281 to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { | |
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