Browse Source

Alternate implementation for supporting custom thumbnails when no media element is defined. Closes NUKnightLab/StoryJS-Core#24 thanks @vedmack for the suggestion

issue580
Joe Germuska 11 years ago
parent
commit
003ce186d2
  1. 13
      source/js/Core/Media/VMM.MediaElement.js

13
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 != "") {
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 = "<div class='thumbnail thumb-custom' id='" + uid + "_custom_thumb'><img src='" + data.thumbnail + "'></div>";
return mediaElem;
} else if (m.type == "image") {
} 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 (m.type == "image") {
mediaElem = "<div class='thumbnail thumb-photo'></div>";
return mediaElem;
} else if (m.type == "flickr") {

Loading…
Cancel
Save