mirror of
https://github.com/yuukiwww/taiko-web.git
synced 2024-09-30 21:29:31 +02:00
Support string song id
This commit is contained in:
parent
08845e17b1
commit
5a2f1a2685
@ -498,6 +498,10 @@ class Search{
|
|||||||
}
|
}
|
||||||
|
|
||||||
proceed(songId){
|
proceed(songId){
|
||||||
|
if (/^-?\d+$/.test(songId)) {
|
||||||
|
songId = parseInt(songId)
|
||||||
|
}
|
||||||
|
|
||||||
var song = this.songSelect.songs.find(song => song.id === songId)
|
var song = this.songSelect.songs.find(song => song.id === songId)
|
||||||
this.remove()
|
this.remove()
|
||||||
this.songSelect.playBgm(false)
|
this.songSelect.playBgm(false)
|
||||||
@ -603,7 +607,7 @@ class Search{
|
|||||||
}else if(e.which === 1){
|
}else if(e.which === 1){
|
||||||
var songEl = e.target.closest(".song-search-result")
|
var songEl = e.target.closest(".song-search-result")
|
||||||
if(songEl){
|
if(songEl){
|
||||||
var songId = parseInt(songEl.dataset.songId)
|
var songId = songEl.dataset.songId
|
||||||
this.proceed(songId)
|
this.proceed(songId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -642,7 +646,7 @@ class Search{
|
|||||||
}
|
}
|
||||||
}else if(name === "confirm"){
|
}else if(name === "confirm"){
|
||||||
if(Number.isInteger(this.active)){
|
if(Number.isInteger(this.active)){
|
||||||
this.proceed(parseInt(this.results[this.active].dataset.songId))
|
this.proceed(this.results[this.active].dataset.songId)
|
||||||
}else{
|
}else{
|
||||||
this.onInput()
|
this.onInput()
|
||||||
if(event.keyCode === 13 && this.songSelect.touchEnabled){
|
if(event.keyCode === 13 && this.songSelect.touchEnabled){
|
||||||
|
Loading…
Reference in New Issue
Block a user