From 003ce186d2e31103cdcaa9f426293b8c3f350092 Mon Sep 17 00:00:00 2001 From: Joe Germuska Date: Tue, 6 May 2014 08:38:52 -0500 Subject: [PATCH] Alternate implementation for supporting custom thumbnails when no media element is defined. Closes NUKnightLab/StoryJS-Core#24 thanks @vedmack for the suggestion --- source/js/Core/Media/VMM.MediaElement.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/js/Core/Media/VMM.MediaElement.js b/source/js/Core/Media/VMM.MediaElement.js index 1ad3d7e..0bc129a 100644 --- a/source/js/Core/Media/VMM.MediaElement.js +++ b/source/js/Core/Media/VMM.MediaElement.js @@ -21,17 +21,18 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { if (h != null && h != "") {_h = h}; if (uid != null && uid != "") {_uid = uid}; - if (data.media != null && data.media != "") { + + if (data.thumbnail != null && data.thumbnail != "") { + trace("CUSTOM THUMB"); + mediaElem = "
"; + return mediaElem; + } else if (data.media != null && data.media != "") { var _valid = true, mediaElem = "", m = VMM.MediaType(data.media); //returns an object with .type and .id // DETERMINE THUMBNAIL OR ICON - if (data.thumbnail != null && data.thumbnail != "") { - trace("CUSTOM THUMB"); - mediaElem = "
"; - return mediaElem; - } else if (m.type == "image") { + if (m.type == "image") { mediaElem = "
"; return mediaElem; } else if (m.type == "flickr") {