Skip to content
Merged
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
6 changes: 6 additions & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,10 @@ public void addTab(BasePanel basePanel, boolean raisePanel) {
// add tab
Tab newTab = new Tab(basePanel.getTabTitle(), basePanel);
tabbedPane.getTabs().add(newTab);
newTab.setOnCloseRequest(event -> {
closeTab((BasePanel) newTab.getContent());
event.consume();
});

// update all tab titles
updateAllTabTitles();
Expand Down Expand Up @@ -1340,6 +1344,8 @@ private void closeTab(BasePanel panel) {
if (panel.isModified() && (context.getLocation() == DatabaseLocation.LOCAL)) {
if (confirmClose(panel)) {
removeTab(panel);
} else {
return;
}
} else if (context.getLocation() == DatabaseLocation.SHARED) {
context.convertToLocalDatabase();
Expand Down