Skip to content

Commit

Permalink
removed commented code;
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Oct 17, 2023
1 parent 01d21e1 commit ef1c380
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions src/question_ranking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,61 +383,6 @@ export class QuestionRankingModel extends QuestionCheckboxModel {
}, 1);
}

// public handleKeydownSelectToRank(event: KeyboardEvent, movedElement: ItemValue) {
// if (this.isDesignMode) return;

// const key: any = event.key;
// if(key !== " " && key !== "ArrowUp" && key !== "ArrowDown") return;

// const dnd:any = this.dragDropRankingChoices; //????
// const rankingChoices = this.rankingChoices;
// const unRankingChoices = this.unRankingChoices;

// const isMovedElementRanked = rankingChoices.indexOf(movedElement) !== -1;
// const isMovedElementUnRanked = !isMovedElementRanked;

// let fromIndex;
// let toIndex;

// if ((key === " " || key === "Enter") && isMovedElementUnRanked) {
// fromIndex = unRankingChoices.indexOf(movedElement);
// toIndex = 0;
// dnd.selectToRank(this, fromIndex, toIndex);
// this.setValueAfterKeydown(toIndex, "to-container");
// return;
// }

// if ((key === " " || key === "Enter") && isMovedElementRanked) {
// fromIndex = rankingChoices.indexOf(movedElement);
// dnd.unselectFromRank(this, fromIndex);
// toIndex = this.unRankingChoices.indexOf(movedElement); //'this.' leads to actual array after the 'unselectFromRank' method
// this.setValueAfterKeydown(toIndex, "from-container");
// return;
// }

// if (key === "ArrowUp" && isMovedElementRanked) {
// fromIndex = rankingChoices.indexOf(movedElement);
// toIndex = fromIndex - 1;

// if (fromIndex < 0) return;

// dnd.reorderRankedItem(this, fromIndex, toIndex);
// this.setValueAfterKeydown(toIndex, "to-container");
// return;
// }

// if (key === "ArrowDown" && isMovedElementRanked) {
// fromIndex = rankingChoices.indexOf(movedElement);
// toIndex = fromIndex + 1;

// if (toIndex >= rankingChoices.length) return;

// dnd.reorderRankedItem(this, fromIndex, toIndex);
// this.setValueAfterKeydown(toIndex, "to-container");
// return;
// }
// }

public handleKeydownSelectToRank(event: KeyboardEvent, movedElement: ItemValue): void {
if (this.isDesignMode) return;
const key: any = event.key;
Expand Down

0 comments on commit ef1c380

Please sign in to comment.