Skip to content

Commit

Permalink
Merge pull request #1371 from dcdenu4/bugfix/1261-workbench-middle-cl…
Browse files Browse the repository at this point in the history
…ick-tab

Close tabs on middle click
  • Loading branch information
davemfish authored Aug 11, 2023
2 parents e395df2 + 2fb7387 commit 3c0f155
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Unreleased Changes
* Closing the main window will now close any user's guide windows that are
open. Fixed a bug where the app could not be reopened after closing.
(`#1258 <https://github.com/natcap/invest/issues/1258>`_)
* Middle clicking an InVEST model tab was opening a blank window. Now
middle clicking will close that tab as expected.
(`#1261 <https://github.com/natcap/invest/issues/1261>`_)
* Forest Carbon
* The biophysical table is now case-insensitive.
* HRA
Expand Down
12 changes: 11 additions & 1 deletion workbench/src/renderer/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,17 @@ export default class App extends React.Component {
key={id}
className={id === activeTab ? 'active' : ''}
>
<Nav.Link eventKey={id}>
<Nav.Link
eventKey={id}
onAuxClick={(event) => {
event.stopPropagation();
event.preventDefault();
if (event.button === 1) {
// middle mouse button clicked, close tab
this.closeInvestModel(id);
}
}}
>
{statusSymbol}
{` ${job.modelHumanName}`}
</Nav.Link>
Expand Down

0 comments on commit 3c0f155

Please sign in to comment.