I am working on developing an in-game panel for a checklist that uses data from SimBrief. It’s using an iFrame, and I have two features I can’t quite figure out.
First…I want the panel to hide with a shortcut key. The Navigraph charts does this and it’s a nice touch so the website closes and does not reload but you can hide the panel. I have a keyboard shortcut listener working (using Ctrl+N) for development. When it detects the key, I append ‘panelInvisible’ to the class, but I don’t think this is right. This method works if I have moved the panel, but if I interact with the panel to load the checklist or on the first load before I interact with it, it won’t hide the panel. I am guessing brute force appending ‘panelInvisible’ isn’t the best way to do this, but watching how the Navigraph Charts panel interacts with the HTML, I can see that when their shortcut key is picked up, it appends ‘panelInactive’ ‘panelInvisible’ to the class. Is there a better way to change or add the panelInvisible class in the JS after picking up a shortcut?
Second, is there any way to prevent the iFrame from reloading when the panel is minimized? I understand the reload when it’s closed, but I would prefer to prevent it from refreshing when it’s minimized.