• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

UpdateDom not working

Scheduled Pinned Locked Moved Development
22 Posts 3 Posters 10.4k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    sharmmoh1983
    last edited by Sep 19, 2017, 3:12 PM

    But in my case I have declared positions in my config . But my issue is if positions of module somehow overlaps or matches top or bottom (like in my case top_left and top_center ) is causing the issue

    1 Reply Last reply Reply Quote 0
    • S Offline
      sharmmoh1983
      last edited by Sep 19, 2017, 3:14 PM

      Kindly assist me in getting this resolved as I am stuck .

      I am planning to hide modules upfront and the enable through voice as in when required

      J 1 Reply Last reply Sep 19, 2017, 3:45 PM Reply Quote 0
      • J Offline
        j.e.f.f Project Sponsor Module Developer @sharmmoh1983
        last edited by j.e.f.f Sep 19, 2017, 3:47 PM Sep 19, 2017, 3:45 PM

        @sharmmoh1983 I’m not sure if the positions of the modules have anything to do with your problem, but I did struggle with a similar problem in one of my modules. Basically you can’t do ANYTHING with the Dom until MM has finished creating all the Dom objects. This will happen well after your module’s start() function is called.

        Basically you need to wait for the notification DOM_OBJECTS_CREATED before you can do things like hide or show the module. Here’s an example:

          notificationReceived: function(notification, payload, sender) {
            if ( notification == 'DOM_OBJECTS_CREATED') {
              //now the Dom is ready; you can call hide() or show().
              this.hide(0, {lockString: this.identifier});
            }
          }
        

        I hope this helps!

        1 Reply Last reply Reply Quote 0
        • S Offline
          sharmmoh1983
          last edited by Sep 19, 2017, 3:55 PM

          But in that case all my modules will be appearing on screen which I don’t want and should only appear at voice command

          J 1 Reply Last reply Sep 19, 2017, 4:02 PM Reply Quote 0
          • J Offline
            j.e.f.f Project Sponsor Module Developer @sharmmoh1983
            last edited by Sep 19, 2017, 4:02 PM

            @sharmmoh1983 Not the case, especially if you call hide(0). This all happens before a single screen refresh, so you won’t see the module on-screen for a split second before it hides.

            1 Reply Last reply Reply Quote 0
            • S Offline
              sharmmoh1983
              last edited by Sep 19, 2017, 4:04 PM

              @j-e-f-f
              I want all modules to hide during start

              ? J 2 Replies Last reply Sep 19, 2017, 4:11 PM Reply Quote 0
              • ? Offline
                A Former User @sharmmoh1983
                last edited by Sep 19, 2017, 4:11 PM

                @sharmmoh1983 instead of hide, how about using display:none in css?

                1 Reply Last reply Reply Quote 0
                • ? Offline
                  A Former User
                  last edited by A Former User Sep 19, 2017, 4:25 PM Sep 19, 2017, 4:24 PM

                  Now i understand whats going on. You had tried to hide modules before dom created.
                  My suggetion is;

                  1. use css for making modules invisible with display:none on startup.(or cover all modules with temp div which has black background on top level)
                  2. after Dom_object_created message received, hide all module with .hide().
                  3. then change css again for displaying, or remove the covered div.
                  4. then you can use your command.
                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    sharmmoh1983
                    last edited by Sep 19, 2017, 4:31 PM

                    @Sean

                    I will look into the approach but I don’t want every module to be off , some commanded by voice so can’t make use of css

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      sharmmoh1983
                      last edited by Sep 19, 2017, 4:33 PM

                      @Sean Also updateDOM is also creating DOM first so there should be no issue of DOM getting created or not

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      1 / 3
                      • First post
                        9/22
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy