Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Use first the image attribute to compute thumbnails, and only after, …
Browse files Browse the repository at this point in the history
…if an image, the contentURL
  • Loading branch information
steren committed Feb 8, 2013
1 parent 3722bd9 commit 73ef128
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/sleek.js
Expand Up @@ -892,13 +892,12 @@ function (Collection, DynamicContainer, Item, List, CardPanel, FadeInPanel, Fact
} }


if (!thumbnailUrl) { if (!thumbnailUrl) {
// No thumbnail URL found yet, return the content of the object // No thumbnail URL found yet, return the value of the image property
// if it is an image, or the value of its image property if set // of the object if set. If not and if image, return its content
if ((item['@type'] === 'ImageObject') && item.contentURL) { if (item.image && item.image.contentURL) {
thumbnailUrl = item.contentURL;
}
else if (item.image && item.image.contentURL) {
thumbnailUrl = item.image.contentURL; thumbnailUrl = item.image.contentURL;
} else if ((item['@type'] === 'ImageObject') && item.contentURL) {
thumbnailUrl = item.contentURL;
} }
} }
if (!thumbnailUrl) { if (!thumbnailUrl) {
Expand Down

0 comments on commit 73ef128

Please sign in to comment.