Refactor
parent
5a0fe421a5
commit
18a4ed5f61
|
@ -462,14 +462,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onArrowDownKey(event) {
|
onArrowDownKey(event) {
|
||||||
let optionIndex = -1;
|
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
|
||||||
|
|
||||||
if (this.focusedOptionIndex !== -1) {
|
|
||||||
optionIndex = this.findNextOptionIndex(this.focusedOptionIndex);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
optionIndex = this.findFirstFocusedOptionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.changeFocusedOptionIndex(event, optionIndex);
|
this.changeFocusedOptionIndex(event, optionIndex);
|
||||||
|
|
||||||
|
@ -486,14 +479,7 @@ export default {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let optionIndex = -1;
|
const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();
|
||||||
|
|
||||||
if (this.focusedOptionIndex !== -1) {
|
|
||||||
optionIndex = this.findPrevOptionIndex(this.focusedOptionIndex);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
optionIndex = this.findLastFocusedOptionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.changeFocusedOptionIndex(event, optionIndex);
|
this.changeFocusedOptionIndex(event, optionIndex);
|
||||||
|
|
||||||
|
|
|
@ -534,14 +534,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onArrowDownKey(event) {
|
onArrowDownKey(event) {
|
||||||
let optionIndex = -1;
|
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
|
||||||
|
|
||||||
if (this.focusedOptionIndex !== -1) {
|
|
||||||
optionIndex = this.findNextOptionIndex(this.focusedOptionIndex);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
optionIndex = this.findFirstFocusedOptionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.shiftKey) {
|
if (event.shiftKey) {
|
||||||
this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);
|
this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);
|
||||||
|
@ -562,14 +555,7 @@ export default {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let optionIndex = -1;
|
const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();
|
||||||
|
|
||||||
if (this.focusedOptionIndex !== -1) {
|
|
||||||
optionIndex = this.findPrevOptionIndex(this.focusedOptionIndex);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
optionIndex = this.findLastFocusedOptionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.shiftKey) {
|
if (event.shiftKey) {
|
||||||
this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);
|
this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);
|
||||||
|
|
Loading…
Reference in New Issue