Fix color fallback
This commit is contained in:
@@ -80,7 +80,8 @@
|
|||||||
var id = "chkFolder" ;
|
var id = "chkFolder" ;
|
||||||
var name = option.name;
|
var name = option.name;
|
||||||
var css = option.css;
|
var css = option.css;
|
||||||
var description = option.description;
|
var description = option.description;
|
||||||
|
|
||||||
//html += '<label><input is="emby-checkbox" class="chkLibrary" type="checkbox" data-mini="true" id="' + id + '" name="' + id + '" data-value="' + value + '" '+' /><span>' + name + '</span></label>';
|
//html += '<label><input is="emby-checkbox" class="chkLibrary" type="checkbox" data-mini="true" id="' + id + '" name="' + id + '" data-value="' + value + '" '+' /><span>' + name + '</span></label>';
|
||||||
html += '<div class="checkboxContainer checkboxContainer-withDescription"><label><input class = "checkbox" type="checkbox" is="emby-checkbox" id="' + id + '"name="' + id + '" data-css="' + css + '" '+' /><span>'+ name +'</span></label><div class="fieldDescription checkboxFieldDescription">'+description+'</div></div>'
|
html += '<div class="checkboxContainer checkboxContainer-withDescription"><label><input class = "checkbox" type="checkbox" is="emby-checkbox" id="' + id + '"name="' + id + '" data-css="' + css + '" '+' /><span>'+ name +'</span></label><div class="fieldDescription checkboxFieldDescription">'+description+'</div></div>'
|
||||||
return html;
|
return html;
|
||||||
@@ -169,11 +170,11 @@
|
|||||||
var colorPickers = document.getElementsByClassName("color");
|
var colorPickers = document.getElementsByClassName("color");
|
||||||
for (let element of colorPickers) {
|
for (let element of colorPickers) {
|
||||||
savedHtml += element.outerHTML
|
savedHtml += element.outerHTML
|
||||||
if(element.getAttribute("data-mode")=="hex"){
|
if(element.getAttribute("data-mode")=="rgba"){
|
||||||
color=element.value;
|
|
||||||
}else if(element.getAttribute("data-mode")=="rgba"){
|
|
||||||
var rgbColor = hexToRgb( element.value);
|
var rgbColor = hexToRgb( element.value);
|
||||||
color = rgbColor.r + "," +rgbColor.g +"," + rgbColor.b;
|
color = rgbColor.r + "," +rgbColor.g +"," + rgbColor.b;
|
||||||
|
} else{
|
||||||
|
color=element.value;
|
||||||
}
|
}
|
||||||
css+= element.getAttribute("data-css").replaceAll("$",color)+ "\n";
|
css+= element.getAttribute("data-css").replaceAll("$",color)+ "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user