Created
December 7, 2012 18:33
-
-
Save afonso-praca/4235341 to your computer and use it in GitHub Desktop.
Set max size to a string
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
getShortName = function(name, size){ return name.length < size ? name : name.substr(0, size) + '...'; }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment