code: function _hidePanelsIfRequired() {
          var panelIDs = WorkspaceManager.getAllPanelIDs();
          _previouslyOpenPanelIDs = [];
          panelIDs.forEach(function (panelID) {
              var panel = WorkspaceManager.getPanelForID(panelID);
              if (panel && panel.isVisible()) {
                  panel.hide();
                  _previouslyOpenPanelIDs.push(panelID);
              }
          });
      }
docs: hide all open panels