From 5e02d715887e3781beb52cbe032f2f6f6241c949 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 24 Jul 2019 21:48:52 +0200 Subject: Fix max contrast retrieval to limit minimum color for relative time Signed-off-by: Morris Jobke --- apps/files/js/filelist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/js/filelist.js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index bfaee261b11..a210b6caac2 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1540,7 +1540,7 @@ try { var maxContrastHex = window.getComputedStyle(document.documentElement) - .getPropertyValue('--color-text-maxcontrast') + .getPropertyValue('--color-text-maxcontrast').trim() var maxContrast = parseInt(maxContrastHex.substring(1, 3), 16) } catch(error) { var maxContrast = OCA.Accessibility -- cgit v1.2.3 From 003e23520d12840a5806a46275db9c9499b5c17c Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 25 Jul 2019 09:45:09 +0200 Subject: Trigger fallback code to get max contrast value and use integer there Signed-off-by: Morris Jobke --- apps/files/js/filelist.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apps/files/js/filelist.js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index a210b6caac2..7a6665b0807 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1541,12 +1541,15 @@ try { var maxContrastHex = window.getComputedStyle(document.documentElement) .getPropertyValue('--color-text-maxcontrast').trim() + if (maxContrastHex.length < 4) { + throw Error(); + } var maxContrast = parseInt(maxContrastHex.substring(1, 3), 16) } catch(error) { var maxContrast = OCA.Accessibility && OCA.Accessibility.theme === 'themedark' - ? '130' - : '118' + ? 130 + : 118 } // size column -- cgit v1.2.3