SongSelect: Add ura difficulty

This commit is contained in:
LoveEevee
2018-10-12 21:04:28 +03:00
parent 6ccdc18ec6
commit f80565f25b
17 changed files with 141 additions and 70 deletions

View File

@@ -8,6 +8,10 @@ class PageEvents{
this.add(window, "mousemove", this.mouseEvent.bind(this))
}
add(target, type, callback){
if(Array.isArray(type)){
type.forEach(type => this.add(target, type, callback))
return
}
this.remove(target, type)
var addedEvent = this.allEvents.get(target)
if(!addedEvent){
@@ -18,6 +22,10 @@ class PageEvents{
return target.addEventListener(type, callback)
}
remove(target, type){
if(Array.isArray(type)){
type.forEach(type => this.remove(target, type))
return
}
var addedEvent = this.allEvents.get(target)
if(addedEvent){
var callback = addedEvent.get(type)