add a disconnected indicator
This commit is contained in:
parent
79416379f4
commit
56d6f98922
@ -189,8 +189,15 @@ class Gamepad {
|
|||||||
*/
|
*/
|
||||||
onGamepadDisconnect(e) {
|
onGamepadDisconnect(e) {
|
||||||
// on gamepad disconnection, remove it from the list
|
// on gamepad disconnection, remove it from the list
|
||||||
|
this.$gamepad.addClass('disconnected');
|
||||||
|
|
||||||
|
window.setTimeout(() => {
|
||||||
|
this.$gamepad.removeClass('disconnected');
|
||||||
|
|
||||||
|
// remove gamepad from the list and start back scanning
|
||||||
this.disconnect(e.gamepad.index);
|
this.disconnect(e.gamepad.index);
|
||||||
this.scan();
|
this.scan();
|
||||||
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 8.7 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Loading…
x
Reference in New Issue
Block a user