mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Only add clock type wrappers to DOM when they are used (#2971)
Fixes a layout gap when digital clock is displayd on the left Reported via discord: https://discord.com/channels/545884423703494657/545884914982322177/1044376412997562418 Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
@@ -303,7 +303,7 @@ Module.register("clock", {
|
||||
}
|
||||
|
||||
/*******************************************
|
||||
* Update placement, respect old analogShowDate even if its not needed anymore
|
||||
* Update placement, respect old analogShowDate even if it's not needed anymore
|
||||
*/
|
||||
if (this.config.displayType === "analog") {
|
||||
// Display only an analog clock
|
||||
@@ -311,16 +311,16 @@ Module.register("clock", {
|
||||
wrapper.classList.add("clockGrid--bottom");
|
||||
} else if (this.config.analogShowDate === "bottom") {
|
||||
wrapper.classList.add("clockGrid--top");
|
||||
} else {
|
||||
//analogWrapper.style.gridArea = "center";
|
||||
}
|
||||
wrapper.appendChild(analogWrapper);
|
||||
} else if (this.config.displayType === "digital") {
|
||||
wrapper.appendChild(digitalWrapper);
|
||||
} else if (this.config.displayType === "both") {
|
||||
wrapper.classList.add("clockGrid--" + this.config.analogPlacement);
|
||||
wrapper.appendChild(analogWrapper);
|
||||
wrapper.appendChild(digitalWrapper);
|
||||
}
|
||||
|
||||
wrapper.appendChild(analogWrapper);
|
||||
wrapper.appendChild(digitalWrapper);
|
||||
|
||||
// Return the wrapper to the dom.
|
||||
return wrapper;
|
||||
}
|
||||
|
Reference in New Issue
Block a user