Replace hexToRgb function to work with legacy mobile browsers
This commit is contained in:
@@ -7,11 +7,15 @@
|
|||||||
<link rel="stylesheet" href="custom.css">
|
<link rel="stylesheet" href="custom.css">
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const hexToRgb = hex =>
|
function hexToRgb(value) {
|
||||||
hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i
|
var aRgbHex = value.substring(1).match(/.{1,2}/g);
|
||||||
,(m, r, g, b) => '#' + r + r + g + g + b + b)
|
var aRgb = [
|
||||||
.substring(1).match(/.{2}/g)
|
parseInt(aRgbHex[0], 16),
|
||||||
.map(x => parseInt(x, 16));
|
parseInt(aRgbHex[1], 16),
|
||||||
|
parseInt(aRgbHex[2], 16)
|
||||||
|
];
|
||||||
|
return aRgb;
|
||||||
|
}
|
||||||
|
|
||||||
function show_loading(visible) {
|
function show_loading(visible) {
|
||||||
document.getElementById('loading').style.visibility = visible ? 'visible' : 'hidden';
|
document.getElementById('loading').style.visibility = visible ? 'visible' : 'hidden';
|
||||||
|
|||||||
Reference in New Issue
Block a user