• 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.

Add module reference to alerts

Scheduled Pinned Locked Moved Feature Requests
alert
7 Posts 3 Posters 4.8k Views 2 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.
  • M Offline
    MichMich Admin
    last edited by Sep 21, 2016, 9:38 AM

    Can’t you just change the z-index of the button in your module’s CSS file?

    S 1 Reply Last reply Sep 21, 2016, 10:03 AM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @MichMich
      last edited by Sep 21, 2016, 10:03 AM

      @MichMich z-Index didn’t work for me, but with the following code I could achieve what I was trying to do.

      MM.getModules().enumerate((module) => {
          if(module.name === 'alert'){
              module.alerts["MMM-AlarmClock"].ntf.addEventListener("click", ()=>{this.resetAlarmClock();});
          }
      });
      

      Please create a github issue if you need help, so I can keep track

      1 Reply Last reply Reply Quote 0
      • M Offline
        MichMich Admin
        last edited by Sep 21, 2016, 10:17 AM

        So no more change to the core is required?

        S 1 Reply Last reply Sep 21, 2016, 10:19 AM Reply Quote 0
        • S Offline
          strawberry 3.141 Project Sponsor Module Developer @MichMich
          last edited by Sep 21, 2016, 10:19 AM

          @MichMich In my oppinion it’s not a good idea to mess around with other modules variables. If someone has a better approach just let me now, but it would work without changes to the core at the moment.

          Please create a github issue if you need help, so I can keep track

          1 Reply Last reply Reply Quote 1
          • P Offline
            paviro Admin
            last edited by Oct 3, 2016, 1:54 PM

            Well feel free to change things in the alert module since it should be rewritten at some point anyway… :D

            We're all stories in the end. Just make it a good one, eh?

            – The Doctor

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              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