From ad8ed89e3c8a339c5c4ab3e1c14347954a7b6fd9 Mon Sep 17 00:00:00 2001 From: rr- Date: Tue, 23 Aug 2016 22:31:56 +0200 Subject: [PATCH] client/general: show empty thumbnails as grid --- client/css/main.styl | 4 ++++ client/js/util/views.js | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/css/main.styl b/client/css/main.styl index 31b04fd..a22d0f6 100644 --- a/client/css/main.styl +++ b/client/css/main.styl @@ -177,6 +177,10 @@ a .access-key height: 100% width: 20px height: 20px + &.empty + background-image: url('/img/transparency_grid.png') + background-repeat: repeat + background-size: initial .flexbox-dummy height: 0 !important diff --git a/client/js/util/views.js b/client/js/util/views.js index 1887cd3..ad2eb84 100644 --- a/client/js/util/views.js +++ b/client/js/util/views.js @@ -42,10 +42,12 @@ function makeRelativeTime(time) { function makeThumbnail(url) { return makeNonVoidElement( 'span', - { - class: 'thumbnail', - style: `background-image: url(\'${url}\')`, - }, + url ? + { + class: 'thumbnail', + style: `background-image: url(\'${url}\')`, + } : + {class: 'thumbnail empty'}, makeVoidElement('img', {alt: 'thumbnail', src: url})); }