]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
ui: Use background-size to scale fanart to fit dvr dialog box.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Tue, 2 Oct 2018 22:28:32 +0000 (23:28 +0100)
committerperexg <perex@perex.cz>
Wed, 3 Oct 2018 06:45:50 +0000 (08:45 +0200)
Previously the fanart could be too big for the dialog. Now we
scale to fit the dialog.

We use 'cover' which can make the image slightly exceed the
dialog dimensions, compared to 'contain' which would leave
space at the top/bottom if the fanart is an odd dimension.
The 'cover' seems better with the fanart I've seen so far.

src/webui/static/app/dvr.js

index 950fbe10b8ba90e22d449a52435f8eee45f130f7..c36957de7cb3ec9cbfeac0cdecfc3401d00b0d95 100644 (file)
@@ -222,6 +222,10 @@ tvheadend.dvrDetails = function(grid, index) {
               'position': 'relative',
               'width' : '100%',
               'height': '100%',
+              // This causes background image to scale on css3 with aspect ratio, image
+              // can overflow, vs. 'contain' which will leave blank space top+bottom to
+              // ensure image is fully displayed in the window
+              'background-size': 'cover',
           });
       }                        // Have fanart div