[Workbench] Double-clicking "show version" link causes modal deadlock
Steps to reproduce:
- Click "?" help menu
- Click "Show version / debugging info..." item twice quickly
- When the dialog appears, click "close" or click outside the dialog to dismiss it
- Dialog disappears but the page is still greyed out, and nothing is clickable.
- Dialog disappears and page returns to normal -- as is would if you had clicked "show version" only once.
- The double-click causes two AJAX requests
- The first JS response fills the #report-issue-modal-window div with some HTML and then opens the modal
- The second JS response overwrites the #report-issue-modal-window div with some (similar/identical) HTML and then opens a new modal
- The "close" button closes the second modal and puts the page back the way it found it (i.e., when the first modal was open)
- The page still has the "unclickable / greyed out" overlay set up by the first modal -- but the first modal's DOM elements are gone, so there is no dialog showing, and no "close" handler anywhere that can put the page back to normal.
- In the "report issue" JS, before overwriting the #report-issue-modal-window element with new content, check whether it already contains a modal that is (or might be) open. If so, close the existing modal before destroying its DOM elements.