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:
RD WebDesign
2023-01-25 21:21:23 -03:00
parent acb7892e9b
commit aa5068bbe9
6 changed files with 16 additions and 22 deletions

View File

@@ -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,
};
})();