Skip to content

Commit

Permalink
Update MMM-Modulebar.js
Browse files Browse the repository at this point in the history
  • Loading branch information
asionyang authored Mar 31, 2021
1 parent f76a2bf commit c8654b4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions MMM-Modulebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Module.register("MMM-Modulebar",{

// Override dom generator.
getDom: function() {
var overlay = document.createElement("div");
var overlay = document.createElement("div");
overlay.className = "paint-it-black";
var menu = document.createElement("span");
menu.className = "modulebar-menu";
Expand All @@ -64,7 +64,7 @@ Module.register("MMM-Modulebar",{
for (var num in this.config.buttons) {
menu.appendChild(this.createButton(this, num, this.config.buttons[num], this.config.picturePlacement, overlay));
}
menu.appendChild(overlay);
menu.appendChild(overlay);

return menu;
},
Expand All @@ -83,11 +83,13 @@ Module.register("MMM-Modulebar",{
// Makes sure the width and height is at least the defined minimum.
item.style.minWidth = self.config.minWidth;
item.style.minHeight = self.config.minHeight;

// Collects all modules loaded in MagicMirror.
var modules = MM.getModules();
// When a button is clicked, the module either gets hidden or shown depending on current module status.
item.addEventListener("click", function () {

if (data.module === "all") {

if( hidden ){
$(overlay).fadeIn(1000);
$(item).css("z-index","100");
Expand Down Expand Up @@ -208,3 +210,5 @@ Module.register("MMM-Modulebar",{
return item;
}
});


0 comments on commit c8654b4

Please sign in to comment.