Merge pull request #16543 from nextcloud/backport/16532/stable16

[stable16] Fix max contrast retrieval to limit minimum color for relative time
This commit is contained in:
Roeland Jago Douma 2019-07-26 08:08:00 +02:00 committed by GitHub
commit 159ff6dd97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -1542,13 +1542,16 @@
try { try {
var maxContrastHex = window.getComputedStyle(document.documentElement) var maxContrastHex = window.getComputedStyle(document.documentElement)
.getPropertyValue('--color-text-maxcontrast') .getPropertyValue('--color-text-maxcontrast').trim()
if (maxContrastHex.length < 4) {
throw Error();
}
var maxContrast = parseInt(maxContrastHex.substring(1, 3), 16) var maxContrast = parseInt(maxContrastHex.substring(1, 3), 16)
} catch(error) { } catch(error) {
var maxContrast = OCA.Accessibility var maxContrast = OCA.Accessibility
&& OCA.Accessibility.theme === 'themedark' && OCA.Accessibility.theme === 'themedark'
? '130' ? 130
: '118' : 118
} }
// size column // size column