mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Apply suggestions
This commit is contained in:
parent
8a200e54af
commit
440675fbee
2 changed files with 6 additions and 19 deletions
|
@ -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
|
// 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) {
|
function attachGamepadScript(e) {
|
||||||
if (isGamepadConnected()) {
|
console.log("Gamepad connected! Attaching gamepadtokey.js script");
|
||||||
console.log("Gamepad connected! Attaching gamepadtokey.js script");
|
window.removeEventListener("gamepadconnected", attachGamepadScript);
|
||||||
window.removeEventListener("gamepadconnected", attachGamepadScript);
|
require(["components/input/gamepadtokey"]);
|
||||||
require(["components/input/gamepadtokey"]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need to check for gamepads manually at load time, the eventhandler will be fired for that
|
// 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) {
|
require(["keyboardnavigation"], function(keyboardnavigation) {
|
||||||
keyboardnavigation.enable();
|
keyboardnavigation.enable();
|
||||||
});
|
});
|
||||||
|
require(["mouseManager"]);
|
||||||
require(["focusPreventScroll"]);
|
require(["focusPreventScroll"]);
|
||||||
require(["autoFocuser"], function(autoFocuser) {
|
require(["autoFocuser"], function(autoFocuser) {
|
||||||
autoFocuser.enable();
|
autoFocuser.enable();
|
||||||
|
@ -907,6 +908,7 @@ var AppInfo = {};
|
||||||
define("serverNotifications", [componentsPath + "/serverNotifications"], returnFirstDependency);
|
define("serverNotifications", [componentsPath + "/serverNotifications"], returnFirstDependency);
|
||||||
define("skinManager", [componentsPath + "/skinManager"], returnFirstDependency);
|
define("skinManager", [componentsPath + "/skinManager"], returnFirstDependency);
|
||||||
define("keyboardnavigation", [componentsPath + "/input/keyboardnavigation"], returnFirstDependency);
|
define("keyboardnavigation", [componentsPath + "/input/keyboardnavigation"], returnFirstDependency);
|
||||||
|
define("mouseManager", [componentsPath + "/input/mouseManager"], returnFirstDependency);
|
||||||
define("scrollManager", [componentsPath + "/scrollManager"], returnFirstDependency);
|
define("scrollManager", [componentsPath + "/scrollManager"], returnFirstDependency);
|
||||||
define("autoFocuser", [componentsPath + "/autoFocuser"], returnFirstDependency);
|
define("autoFocuser", [componentsPath + "/autoFocuser"], returnFirstDependency);
|
||||||
define("connectionManager", [], function () {
|
define("connectionManager", [], function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue