fix bug where listener got registered twice

This commit is contained in:
sirjonasxx 2018-11-06 15:43:56 +01:00
parent 3636c42245
commit d1bbb3cb52
2 changed files with 1 additions and 5 deletions

View File

@ -79,10 +79,8 @@ public class ExtensionItemContainer extends GridPane {
Tooltip delete = new Tooltip("Close connection with this extension"); Tooltip delete = new Tooltip("Close connection with this extension");
Tooltip.install(exitButton,delete); Tooltip.install(exitButton,delete);
exitButton.show(); exitButton.show();
exitButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isRemoveClickTrigger());
clickButton = new SimpleClickButton(); clickButton = new SimpleClickButton();
clickButton.show(); clickButton.show();
clickButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isClickTrigger());
buttonsBox = new HBox(clickButton, exitButton); buttonsBox = new HBox(clickButton, exitButton);

View File

@ -291,9 +291,7 @@ public class Extensions extends SubForm {
e.printStackTrace(); e.printStackTrace();
} }
}); });
extension.onClick(observable -> { extension.onClick(observable -> extension.sendMessage(new HPacket(OUTGOING_MESSAGES_IDS.ONDOUBLECLICK)));
extension.sendMessage(new HPacket(OUTGOING_MESSAGES_IDS.ONDOUBLECLICK));
});
Platform.runLater(() -> producer.extensionConnected(extension)); Platform.runLater(() -> producer.extensionConnected(extension));
} }