From e3605001e42261227eeb77f4ca831ac62bf7074c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 24 Aug 2021 22:04:06 +1000 Subject: [PATCH] Simple function to render a thumbnail --- InvenTree/templates/js/dynamic/inventree.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/InvenTree/templates/js/dynamic/inventree.js b/InvenTree/templates/js/dynamic/inventree.js index acfd57762c..632c5650c1 100644 --- a/InvenTree/templates/js/dynamic/inventree.js +++ b/InvenTree/templates/js/dynamic/inventree.js @@ -315,6 +315,22 @@ function enableDragAndDrop(element, url, options) { }); } + +function thumbnailImage(url, options={}) { + /* Render a simple thumbnail image from the provided URL */ + + if (!url) { + url = '/static/img/blank_img.png'; + } + + // TODO: Support insertion of custom classes + + var html = ``; + + return html; + +} + function imageHoverIcon(url) { /* Render a small thumbnail icon for an image. * On mouseover, display a full-size version of the image