Snille/MMM-Modulebar

Feature Request: groups to make the buttons mutually exclusive

cydergoth opened this issue · 2 comments

It would be nice to be able to take a set of the buttons and put them into a mutually exclusive group where selecting one in the group automatically hides the others.

Hi, I have actually solved this by using two instances of the module. the first one just have one button and is shown by default, The other one is hidden by default. When pushning the default (only) button on the first one it hides the "current" modulebar and shows the second one with all the buttons... See config below... :) It's not completely smooth but works. You could expand this with more buttons on the first one and set each to show different module bars. :)

		// The first module bar that is shown by default.
		{
			disabled: false,
			module: "MMM-Modulebar",
			position: "bottom_bar",
			classes: "default everyone", // <- Module shown by default.
			config: {
				showBorder: false,
				allowForce: true,
				buttons: {
					"1": {
						// This button hides the current buttonbar and shows the one below.
						module: "MMM-Modulebar",
						idnum: [56,57], // <- The ID-numbers of both the Module bars (You have to change to your own ID-numbers of your modules bars).
						symbol: "bars",
						height: 50,
						width: 50,
					}
				}
			}
		},
		// The second module bar that is shown when pushing the first module bars only button.
		{
			disabled: false,
			module: "MMM-Modulebar",
			position: "bottom_bar",
			classes: "none", // <- Module hidden by default.
			config: {
				showBorder: false,
				allowForce: true,
				buttons: {
					"2": {
						// This button hides the current buttonbar and shows the one above.
						module: "MMM-Modulebar",
						idnum: [56,57], // <- The ID-numbers of both the Module bars (You have to change to your own ID-numbers of your modules bars).
						symbol: "bars",
						height: 50,
						width: 50,
					},
					"4": {
						module: "clock",
						symbol: "clock-o"
					},
					"6": {
						module: "currentweather",
						symbol: "cloud"
					},
					"8": {
						module: "weatherforecast",
						symbol: "compass"
					},
					// All the buttons....
				}
			}
		},

I'll close this one for now. I hope the solution was ok. :)