Skip to content

Commit e51c269

Browse files
authored
Merge pull request #16532 from nextcloud/bugfix/14776/maxcontrast-fix
Fix max contrast retrieval to limit minimum color for relative time
2 parents c504ed6 + 003e235 commit e51c269

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/files/js/filelist.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,13 +1540,16 @@
15401540

15411541
try {
15421542
var maxContrastHex = window.getComputedStyle(document.documentElement)
1543-
.getPropertyValue('--color-text-maxcontrast')
1543+
.getPropertyValue('--color-text-maxcontrast').trim()
1544+
if (maxContrastHex.length < 4) {
1545+
throw Error();
1546+
}
15441547
var maxContrast = parseInt(maxContrastHex.substring(1, 3), 16)
15451548
} catch(error) {
15461549
var maxContrast = OCA.Accessibility
15471550
&& OCA.Accessibility.theme === 'themedark'
1548-
? '130'
1549-
: '118'
1551+
? 130
1552+
: 118
15501553
}
15511554

15521555
// size column

0 commit comments

Comments
 (0)