Skip to content

Commit

Permalink
Merge 1e0c842 into c0e7468
Browse files Browse the repository at this point in the history
  • Loading branch information
JeridiOmar authored Feb 9, 2023
2 parents c0e7468 + 1e0c842 commit e5f568e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void updateItem(Interview item, boolean empty) {
InterviewSelectorCellController newController = new InterviewSelectorCellController(item, this, commandFactory);
loader.setController(newController);
controller = newController;

//setOnMousePressed(e->e.consume());
//Mouse click event
setOnMouseClicked(event -> {
commandFactory.selectCurrentInterview(item, true).execute();
Expand Down Expand Up @@ -113,20 +113,29 @@ private void addDragAndDrop(InterviewSelectorCellController newController) {
int thisIdx = items.indexOf(getItem());
int newPosition;
Section section = this.mouseIsDraggingOn(event.getY());
if (section == Section.top && thisIdx != 0) {
newPosition = thisIdx - 1;
} else {
newPosition = thisIdx;
//keep track of selected and target interview before the remove
Interview targetInterview= items.get(thisIdx);
Interview selectedInterview=items.get(selectedInterviewIndex);
Interview draggedInterview = items.remove(draggedIdx);
int newTargetIndex= items.indexOf(targetInterview);
System.out.println(newTargetIndex);
if (section == Section.top) {
newPosition = newTargetIndex;
}else {
newPosition = newTargetIndex+1;
}
// items.set(draggedIdx, getItem());
// items.set(thisIdx, DragStore.getDraggable());
// this.getListView().setItems(items);
Interview selectedInterview = items.remove(draggedIdx);
items.add(newPosition, selectedInterview);



items.add(newPosition, draggedInterview);
if (selectedInterviewIndex == draggedIdx) {
this.getListView().getSelectionModel().select(newPosition);
selectedInterviewIndex = newPosition;
} else {
selectedInterviewIndex=items.indexOf(selectedInterview);
this.getListView().getSelectionModel().select(selectedInterviewIndex);
}
success = true;
Expand Down
Binary file modified src/main/resources/images/interview-7092be.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/interview-8671cd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/interview-b5e61d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/interview-b97a57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/interview-f15252.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/interview-ffaec9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/interview-ffc90e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5f568e

Please sign in to comment.