Trigger fallback code to get max contrast value and use integer there

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2019-07-25 09:45:09 +02:00
parent 5e02d71588
commit 003e23520d
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 5 additions and 2 deletions

View File

@ -1541,12 +1541,15 @@
try { try {
var maxContrastHex = window.getComputedStyle(document.documentElement) var maxContrastHex = window.getComputedStyle(document.documentElement)
.getPropertyValue('--color-text-maxcontrast').trim() .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