msfs-webui-devkit icon indicating copy to clipboard operation
msfs-webui-devkit copied to clipboard

error reloading a toolbar page ( not a panel )

Open virtualisoftware opened this issue 3 years ago • 1 comments

When pressing the R button on a toolbar page that is not part of a panel, the following error appears:

msfs-webui-devkit_error1 Debugging a toolbar module with the previous version used to work.

virtualisoftware avatar May 26 '21 09:05 virtualisoftware

Replacing the panel variable on these lines with this.m_debugPanel seems to work for me.

if (sessionStorage.getItem("dbgpanel_collapsed") != null) {
  const collapsed = sessionStorage.getItem("dbgpanel_collapsed");
- if(collapsed === "true" && !panel.classList.contains("collapsed")){
+ if(collapsed === "true" && !this.m_debugPanel.classList.contains("collapsed")){
      this.TogglePanelCollapsed();
- } else if(collapsed === "false" && panel.classList.contains("collapsed")){
+ } else if(collapsed === "false" && this.m_debugPanel.classList.contains("collapsed")){
      this.TogglePanelCollapsed();
  }
} else {
  this.TogglePanelCollapsed();
}

Not sure where the panel variable is supposed to come from, but I can't find it anywhere in the debug.js code and I am seeing the same error without the above changes.

SkySails avatar Jun 08 '21 15:06 SkySails