Skip to content

Instantly share code, notes, and snippets.

@wmill
Created April 1, 2013 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmill/5283022 to your computer and use it in GitHub Desktop.
Save wmill/5283022 to your computer and use it in GitHub Desktop.
App.RedditLink = Ember.Object.extend({
/*
It seems reddit will return the string 'default' when there's no thumbnail present.
This computed property will convert 'default' to null to avoid rendering a broken
image link.
*/
thumbnailUrl: function() {
var thumbnail = this.get('thumbnail');
return (thumbnail === 'default') ? null : thumbnail;
}.property('thumbnail'),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment