Merge pull request #16532 from nextcloud/bugfix/14776/maxcontrast-fix

Fix max contrast retrieval to limit minimum color for relative time
This commit is contained in:
Morris Jobke 2019-07-25 17:07:22 +02:00 committed by GitHub
commit e51c269dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -1540,13 +1540,16 @@
try {
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)
} catch(error) {
var maxContrast = OCA.Accessibility
&& OCA.Accessibility.theme === 'themedark'
? '130'
: '118'
? 130
: 118
}
// size column