From 0a382be9bce0b1372c875fa8c639705d4220dc3d Mon Sep 17 00:00:00 2001 From: rlx Date: Mon, 18 Jan 2016 11:23:59 +0530 Subject: [PATCH] avoid info panel reflow --- static/js/info.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/js/info.js b/static/js/info.js index f0c7162..8d45d67 100644 --- a/static/js/info.js +++ b/static/js/info.js @@ -44,7 +44,19 @@ oml.ui.info = function() { src: '/' + id + '/' + ui.icons + '128.jpg?' + data.modified }) - .css({margin: '16px 0 8px 0'}) + .css({ + margin: '16px 0 8px 0', + height: '128px' + }) + .bind({ + load: function() { + if (data.coverRatio > 1) { + $(this).css({ + height: (128 / data.coverRatio) + 'px' + }); + } + } + }) .appendTo(that); $('
') .addClass('OxSelectable')