From cf1e1670c4fc16c6006e802e22724ee2a957a3c3 Mon Sep 17 00:00:00 2001 From: rr- <rr-@sakuya.pl> Date: Sat, 10 Sep 2016 16:13:57 +0200 Subject: [PATCH] client/posts: allow clicking on upload thumbnails --- client/css/post-upload.styl | 6 +++++- client/html/post_upload_row.tpl | 14 +++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/css/post-upload.styl b/client/css/post-upload.styl index ac5cbfa..30f6e22 100644 --- a/client/css/post-upload.styl +++ b/client/css/post-upload.styl @@ -40,12 +40,16 @@ label margin-right: 1em - .thumbnail + .thumbnail-wrapper float: left width: 12.5em height: 7em margin: 0.2em 1em 0 0 + .thumbnail + width: 100% + height: 100% + .controls float: right a diff --git a/client/html/post_upload_row.tpl b/client/html/post_upload_row.tpl index 7f688bb..0e61212 100644 --- a/client/html/post_upload_row.tpl +++ b/client/html/post_upload_row.tpl @@ -5,17 +5,21 @@ <a href class='remove'><i class='fa fa-remove'></i></a> </div> - <div class='thumbnail'> + <div class='thumbnail-wrapper'> <% if (['image'].includes(ctx.uploadable.type)) { %> - <%= ctx.makeThumbnail(ctx.uploadable.previewUrl) %> + <a href='<%= ctx.uploadable.previewUrl %>'> + <%= ctx.makeThumbnail(ctx.uploadable.previewUrl) %> + </a> <% } else if (['video'].includes(ctx.uploadable.type)) { %> <div class='thumbnail'> - <video id='video' nocontrols muted> - <source type='<%- ctx.uploadable.mimeType %>' src='<%- ctx.uploadable.previewUrl %>'/> - </video> + <a href='<%= ctx.uploadable.previewUrl %>'> + <video id='video' nocontrols muted> + <source type='<%- ctx.uploadable.mimeType %>' src='<%- ctx.uploadable.previewUrl %>'/> + </video> + </a> </div> <% } else { %>