mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 10:48:26 +00:00
create utils.getGraphType() function.
also apply setting to long term graphs flip logic - only return "line" if the setting is explicitly set to "false" Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
@@ -207,6 +207,11 @@ function stateLoadCallback(itemName) {
|
||||
return data;
|
||||
}
|
||||
|
||||
function getGraphType() {
|
||||
// Only return line if `barchart_chkbox` is explicitly set to false. Else return bar
|
||||
return localStorage.getItem("barchart_chkbox") === "false" ? "line" : "bar";
|
||||
}
|
||||
|
||||
window.utils = (function () {
|
||||
return {
|
||||
escapeHtml: escapeHtml,
|
||||
@@ -220,6 +225,7 @@ window.utils = (function () {
|
||||
validateIPv6CIDR: validateIPv6CIDR,
|
||||
setBsSelectDefaults: setBsSelectDefaults,
|
||||
stateSaveCallback: stateSaveCallback,
|
||||
stateLoadCallback: stateLoadCallback
|
||||
stateLoadCallback: stateLoadCallback,
|
||||
getGraphType: getGraphType
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user