From c1400969db08b3a84c157846a0779d11bb222ff1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 27 Jan 2016 11:58:21 -0500 Subject: [PATCH] fix image scaling --- dashboard-ui/scripts/librarybrowser.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 069e25e2a7..0b85ca2b94 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -31,14 +31,17 @@ function getDesiredAspect(shape) { - switch (shape) { - - case 'square': - return 1; - case 'backdrop': - return (16 / 9); - case 'portrait': + if (shape) { + shape = shape.toLowerCase(); + if (shape.indexOf('portrait') != -1) { return (2 / 3); + } + if (shape.indexOf('backdrop') != -1) { + return (16 / 9); + } + if (shape.indexOf('square') != -1) { + return 1; + } } return null; }