Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close tabs on middle click #1371

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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