fix button and fix service sync simbg
This commit is contained in:
@@ -591,32 +591,55 @@ document.addEventListener("DOMContentLoaded", async function (e) {
|
||||
await new BigData().init();
|
||||
});
|
||||
|
||||
// function resizeDashboard() {
|
||||
// //Target Width
|
||||
// let targetElement = document.getElementById("dashboard-fixed-wrapper");
|
||||
// let targetWidth = targetElement.offsetWidth;
|
||||
// //console.log("TARGET ",targetWidth);
|
||||
|
||||
// //Real Object Width
|
||||
// let dashboardElement = document.getElementById("dashboard-fixed-container");
|
||||
// let dashboardWidth = 1110; //dashboardElement.offsetWidth;
|
||||
// //console.log("CURRENT ",dashboardWidth);
|
||||
|
||||
// if (targetWidth > dashboardWidth) {
|
||||
// targetWidth = dashboardWidth;
|
||||
// }
|
||||
|
||||
// dashboardElement.style.transformOrigin = "left top";
|
||||
// dashboardElement.style.transition = "transform 0.2s ease-in-out";
|
||||
// dashboardElement.style.transform =
|
||||
// "scale(" + (targetWidth / dashboardWidth).toFixed(2) + ")";
|
||||
// //console.log("SCALE ", (targetWidth/dashboardWidth).toFixed(2));
|
||||
// }
|
||||
|
||||
// window.addEventListener("load", function () {
|
||||
// resizeDashboard();
|
||||
// });
|
||||
|
||||
// window.addEventListener("resize", function () {
|
||||
// resizeDashboard();
|
||||
// });
|
||||
|
||||
function resizeDashboard() {
|
||||
//Target Width
|
||||
let targetElement = document.getElementById("dashboard-fixed-wrapper");
|
||||
let targetWidth = targetElement.offsetWidth;
|
||||
//console.log("TARGET ",targetWidth);
|
||||
|
||||
//Real Object Width
|
||||
let dashboardElement = document.getElementById("dashboard-fixed-container");
|
||||
let dashboardWidth = 1110; //dashboardElement.offsetWidth;
|
||||
//console.log("CURRENT ",dashboardWidth);
|
||||
|
||||
if (targetWidth > dashboardWidth) {
|
||||
targetWidth = dashboardWidth;
|
||||
}
|
||||
let targetWidth = targetElement.offsetWidth;
|
||||
let dashboardWidth = 1110;
|
||||
|
||||
let scaleFactor = (targetWidth / dashboardWidth).toFixed(2);
|
||||
|
||||
// Prevent scaling beyond 1 (100%) to avoid overflow
|
||||
scaleFactor = Math.min(scaleFactor, 1);
|
||||
|
||||
dashboardElement.style.transformOrigin = "left top";
|
||||
dashboardElement.style.transition = "transform 0.2s ease-in-out";
|
||||
dashboardElement.style.transform =
|
||||
"scale(" + (targetWidth / dashboardWidth).toFixed(2) + ")";
|
||||
//console.log("SCALE ", (targetWidth/dashboardWidth).toFixed(2));
|
||||
dashboardElement.style.transform = `scale(${scaleFactor})`;
|
||||
|
||||
// Ensure horizontal scrolling is allowed if necessary
|
||||
document.body.style.overflowX = "auto";
|
||||
}
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
resizeDashboard();
|
||||
});
|
||||
|
||||
window.addEventListener("resize", function () {
|
||||
resizeDashboard();
|
||||
});
|
||||
window.addEventListener("load", resizeDashboard);
|
||||
window.addEventListener("resize", resizeDashboard);
|
||||
|
||||
Reference in New Issue
Block a user