add a disconnected indicator

This commit is contained in:
e7d 2020-08-18 09:53:33 +02:00
parent 79416379f4
commit 56d6f98922
No known key found for this signature in database
GPG Key ID: F320BE007C0B8881
3 changed files with 13 additions and 6 deletions

View File

@ -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.disconnect(e.gamepad.index); this.$gamepad.addClass('disconnected');
this.scan();
window.setTimeout(() => {
this.$gamepad.removeClass('disconnected');
// remove gamepad from the list and start back scanning
this.disconnect(e.gamepad.index);
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