From 9283f28826994f94e09bc4007db07abb8ab95ad5 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 26 Jun 2016 23:59:44 +0200 Subject: [PATCH] image css, only set float: left if not img is not in figure --- config.jsonc | 2 +- static/js/infoView.urg.js | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/config.jsonc b/config.jsonc index 97b3974..fbbd626 100644 --- a/config.jsonc +++ b/config.jsonc @@ -636,7 +636,7 @@ displayed at the top of the screen. This title can be customized by adding "/static/js/getItemTitle.SITENAME.js". */ - "itemTitleKeys": ["title", "director", "date"], + "itemTitleKeys": ["title", "director", "year"], /* "itemViews" is an ordered list of available item views. Implemented views are "info", "documents", "player", "editor", "timeline", "clips", "map", diff --git a/static/js/infoView.urg.js b/static/js/infoView.urg.js index b17c4d5..d030280 100644 --- a/static/js/infoView.urg.js +++ b/static/js/infoView.urg.js @@ -260,12 +260,7 @@ pandora.ui.infoView = function(data) { clickLink: pandora.clickLink, collapseToEnd: false, editable: canEdit, - format: function(value) { - return value.replace( - /').html(value); + $html.find('img').each(function(i, img) { + var $img = $(img), + css = { + 'max-width': '256px', + 'max-height': '256px', + 'margin': '0 16px 16px 0' + }; + if (!$img.parents('figure').length) { + css['float'] = 'left'; + } + $img.css(css); + }); + return $html.html(); + } + function renderGroup(keys) { var $element; if (canEdit || keys.filter(function(key) {