mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
search fixes
This commit is contained in:
parent
6c8b635c2a
commit
ca9c602b67
@ -90,7 +90,7 @@ class SongSelect{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.songSkin["default"].sort = songSkinLength + 1
|
this.songSkin["default"].sort = songSkinLength + 1
|
||||||
|
|
||||||
Object.keys(this.songSkin).forEach(key => {
|
Object.keys(this.songSkin).forEach(key => {
|
||||||
var skin = this.songSkin[key]
|
var skin = this.songSkin[key]
|
||||||
var stripped = key.replace(/\W/g, '')
|
var stripped = key.replace(/\W/g, '')
|
||||||
@ -410,31 +410,30 @@ class SongSelect{
|
|||||||
}else if (this.search){
|
}else if (this.search){
|
||||||
if(name === "back" || (event && event.code === "KeyF" && ctrl)) {
|
if(name === "back" || (event && event.code === "KeyF" && ctrl)) {
|
||||||
this.removeSearch(true)
|
this.removeSearch(true)
|
||||||
}else if(name === "down"){
|
}else if(name === "down" && this.search.results.length){
|
||||||
if(this.search.input == document.activeElement && this.search.results){
|
if(this.search.input == document.activeElement && this.search.results){
|
||||||
this.searchSetActive(0)
|
this.searchSetActive(0)
|
||||||
}else if(this.search.active === this.search.results.length-1){
|
}else if(this.search.active === this.search.results.length-1){
|
||||||
this.searchSetActive(null)
|
this.searchSetActive(null)
|
||||||
this.search.input.focus()
|
this.search.input.focus()
|
||||||
}else if(this.search.active !== null){
|
}else if(Number.isInteger(this.search.active)){
|
||||||
this.searchSetActive(this.search.active+1)
|
this.searchSetActive(this.search.active+1)
|
||||||
}else{
|
}else{
|
||||||
this.searchSetActive(0)
|
this.searchSetActive(0)
|
||||||
}
|
}
|
||||||
}else if(name === "up"){
|
}else if(name === "up" && this.search.results.length){
|
||||||
if(this.search.input == document.activeElement && this.search.results){
|
if(this.search.input == document.activeElement && this.search.results){
|
||||||
this.searchSetActive(this.search.results.length-1)
|
this.searchSetActive(this.search.results.length-1)
|
||||||
}else if(this.search.active === 0){
|
}else if(this.search.active === 0){
|
||||||
this.searchSetActive(null)
|
this.searchSetActive(null)
|
||||||
this.search.input.focus()
|
this.search.input.focus()
|
||||||
//this.search.input.setSelectionRange(this.search.input.value.length, this.search.input.value.length)
|
}else if(Number.isInteger(this.search.active)){
|
||||||
}else if(this.search.active !== null){
|
|
||||||
this.searchSetActive(this.search.active-1)
|
this.searchSetActive(this.search.active-1)
|
||||||
}else{
|
}else{
|
||||||
this.searchSetActive(this.search.results.length-1)
|
this.searchSetActive(this.search.results.length-1)
|
||||||
}
|
}
|
||||||
}else if(name === "confirm"){
|
}else if(name === "confirm"){
|
||||||
if(this.search.active !== null){
|
if(Number.isInteger(this.search.active)){
|
||||||
this.searchProceed(parseInt(this.search.results[this.search.active].dataset.song_id))
|
this.searchProceed(parseInt(this.search.results[this.search.active].dataset.song_id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user