mirror of
https://github.com/pi-hole/web.git
synced 2026-04-20 00:39:52 +01:00
Using a new function to retrieve CSS values from classes
- create a new function to access CSS values, even if not directly used on the page; - remove the empty harcoded HTML `<span>` placeholders used only to source the colors from CSS classes Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -408,6 +408,13 @@ function changeBulkDeleteStates(table) {
|
||||
}
|
||||
}
|
||||
|
||||
function getCSSval(cssclass, cssproperty) {
|
||||
var elem = $("<div class='" + cssclass + "'></div>"),
|
||||
val = elem.appendTo("body").css(cssproperty);
|
||||
elem.remove();
|
||||
return val;
|
||||
}
|
||||
|
||||
window.utils = (function () {
|
||||
return {
|
||||
escapeHtml: escapeHtml,
|
||||
@@ -432,5 +439,6 @@ window.utils = (function () {
|
||||
colorBar: colorBar,
|
||||
checkMessages: checkMessages,
|
||||
changeBulkDeleteStates: changeBulkDeleteStates,
|
||||
getCSSval: getCSSval,
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user