mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
[Feature Request] Allow to make an display order of module position in config (#3762)
My proposal for #3761 * I use `flex` box for create region container * I have moved `container` definition to `main.css` (for css tunning, maybe it can be useful) * I create `order` in module config for define module order display from position # Advantage: We don't have to move module config in another place in array of modules # Another advantage that i did'nt think: We can change dynamicaly module order of a container: - So, in this case, for a module config builder, (I won't mention the name because otherwise I'll get angry...) It can be usefull for a config preview (before saving config) --> just change style css `order` module value for see preview - Or, change `order` value in dev console for testing # Disadvantages I don't see any ;)
This commit is contained in:
committed by
GitHub
parent
7b4d363b07
commit
2831ae985c
@@ -30,6 +30,8 @@ const MM = (function () {
|
||||
dom.className = `module ${dom.className} ${module.data.classes}`;
|
||||
}
|
||||
|
||||
dom.style.order = (typeof module.data.order === "number" && Number.isInteger(module.data.order)) ? module.data.order : 0;
|
||||
|
||||
dom.opacity = 0;
|
||||
wrapper.appendChild(dom);
|
||||
|
||||
@@ -463,7 +465,8 @@ const MM = (function () {
|
||||
}
|
||||
});
|
||||
|
||||
wrapper.style.display = showWrapper ? "block" : "none";
|
||||
// move container definitions to main CSS
|
||||
wrapper.className = showWrapper ? "container" : "container hidden";
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user