mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 02:48:19 -07:00
Apply suggestions
This commit is contained in:
parent
8a200e54af
commit
440675fbee
@ -145,28 +145,13 @@ define(["inputManager", "layoutManager"], function (inputManager, layoutManager)
|
||||
}
|
||||
});
|
||||
}
|
||||
// For hiding the mouse while playbackç
|
||||
require(["components/input/mouseManager"]);
|
||||
|
||||
// Gamepad initialization. No script is required if no gamepads are at boot time, saving a bit of resources._10k
|
||||
// Gamepad initialisation. No script is required if no gamepads are present at init time, saving a bit of resources.
|
||||
// Whenever the gamepad is connected, we hand all the control of the gamepad to gamepadtokey.js by removing the event handler
|
||||
function isGamepadConnected() {
|
||||
var gamepads = navigator.getGamepads();
|
||||
for (var i = 0, len = gamepads.length; i < len; i++) {
|
||||
var gamepad = gamepads[i];
|
||||
if (gamepad) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function attachGamepadScript(e) {
|
||||
if (isGamepadConnected()) {
|
||||
console.log("Gamepad connected! Attaching gamepadtokey.js script");
|
||||
window.removeEventListener("gamepadconnected", attachGamepadScript);
|
||||
require(["components/input/gamepadtokey"]);
|
||||
}
|
||||
console.log("Gamepad connected! Attaching gamepadtokey.js script");
|
||||
window.removeEventListener("gamepadconnected", attachGamepadScript);
|
||||
require(["components/input/gamepadtokey"]);
|
||||
}
|
||||
|
||||
// No need to check for gamepads manually at load time, the eventhandler will be fired for that
|
||||
|
@ -492,6 +492,7 @@ var AppInfo = {};
|
||||
require(["keyboardnavigation"], function(keyboardnavigation) {
|
||||
keyboardnavigation.enable();
|
||||
});
|
||||
require(["mouseManager"]);
|
||||
require(["focusPreventScroll"]);
|
||||
require(["autoFocuser"], function(autoFocuser) {
|
||||
autoFocuser.enable();
|
||||
@ -907,6 +908,7 @@ var AppInfo = {};
|
||||
define("serverNotifications", [componentsPath + "/serverNotifications"], returnFirstDependency);
|
||||
define("skinManager", [componentsPath + "/skinManager"], returnFirstDependency);
|
||||
define("keyboardnavigation", [componentsPath + "/input/keyboardnavigation"], returnFirstDependency);
|
||||
define("mouseManager", [componentsPath + "/input/mouseManager"], returnFirstDependency);
|
||||
define("scrollManager", [componentsPath + "/scrollManager"], returnFirstDependency);
|
||||
define("autoFocuser", [componentsPath + "/autoFocuser"], returnFirstDependency);
|
||||
define("connectionManager", [], function () {
|
||||
|
Loading…
Reference in New Issue
Block a user