Read the statement by Michael Teeuw here.
Module Position
-
@dherl0623 ty Ik I can change it in there, but would have been cool to change during runtime so I can blend the module in at whatever place I currently need it ;) Well can’t change when it’s not possible
-
@maxbachmann there is now magicmirror api for it, but you could manipulate the dom and set the module in a different region manually.
-
@strawberry-3-141
How can I do that in there (sorry I am a absolute noob with the dom) -
I just asked my friend google:
var d = document.getElementById(wrapper); d.style.left = newx_pos; d.style.top = newy_pos;
is that how to do it?
-
@maxbachmann no, you would get the module itself, the wrapper has an id with the identifier of the module, then you would get the wrapper of the position and would call appendChild with your module
-
@strawberry-3-141 Can you help me with how that would look like in software? I am sorry this project is the first time I use javascript at all and absolutely clueless when it’s about the dom
-
// get the module to move with it's identifier var clock = document.getElementById('module_0_clock'); // append it to the region you like document.querySelector('div.region.top.left div.container').appendChild(clock);
it will work only if you already have a module in that position, otherwise you need to ovverride the style to display block
document.querySelector('div.region.top.left div.container').style.display = 'block';
that’s it
-
@strawberry-3-141 So I always have to know wether there is already a element in that region? Is there a way to check all modules and return the ID’s of the elements that are in this position?
-
@strawberry-3-141 and where to add that? is that already the “end code”? I tried in the domupdate function and it did not work, so I guess that was wrong
-
it is safe to always run the code so you don’t need to check if there is a module necessarily.
it is not related to the get dom function, you can put it where ever you want except node_helper (because its not executed in the browser)
can you post the code of your module or upload it to github, then i can have a look