code quality

This commit is contained in:
bkfox
2023-03-13 17:47:00 +01:00
parent 934817da8a
commit 112770eddf
162 changed files with 4798 additions and 4069 deletions

View File

@ -110,7 +110,7 @@ export default {
index = Math.min(index, this.items.length-1)
return this.items[index]
},
selectedValue() {
let value = this.itemValue(this.selected)
if(!value && !this.mustExist)
@ -144,19 +144,19 @@ export default {
this.cursor = -1;
this.selectedIndex = -1;
},
move(index=-1, relative=false) {
if(relative)
index += this.cursor
this.cursor = Math.max(-1, Math.min(index, this.items.length-1))
},
select(index=-1, relative=false, active=null) {
if(relative)
index += this.selectedIndex
else if(index == this.selectedIndex)
return
this.selectedIndex = Math.max(-1, Math.min(index, this.items.length-1))
if(index >= 0) {
this.inputValue = this.selectedLabel
@ -245,4 +245,3 @@ export default {
}
</script>