mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Enable subtitle sync slider focus and keyboard dragging
This commit is contained in:
parent
9f13e2a36c
commit
fe85c5f96c
@ -1,4 +1,4 @@
|
||||
define(['playbackManager', 'text!./subtitlesync.template.html', 'css!./subtitlesync'], function (playbackManager, template, css) {
|
||||
define(['playbackManager', 'layoutManager', 'text!./subtitlesync.template.html', 'css!./subtitlesync'], function (playbackManager, layoutManager, template, css) {
|
||||
"use strict";
|
||||
|
||||
var player;
|
||||
@ -10,6 +10,7 @@ define(['playbackManager', 'text!./subtitlesync.template.html', 'css!./subtitles
|
||||
function init(instance) {
|
||||
|
||||
var parent = document.createElement('div');
|
||||
document.body.appendChild(parent);
|
||||
parent.innerHTML = template;
|
||||
|
||||
subtitleSyncSlider = parent.querySelector(".subtitleSyncSlider");
|
||||
@ -17,6 +18,14 @@ define(['playbackManager', 'text!./subtitlesync.template.html', 'css!./subtitles
|
||||
subtitleSyncCloseButton = parent.querySelector(".subtitleSync-closeButton");
|
||||
subtitleSyncContainer = parent.querySelector(".subtitleSyncContainer");
|
||||
|
||||
if (layoutManager.tv) {
|
||||
subtitleSyncSlider.classList.add("focusable");
|
||||
// HACK: Delay to give time for registered element attach (Firefox)
|
||||
setTimeout(function () {
|
||||
subtitleSyncSlider.enableKeyboardDragging();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
subtitleSyncContainer.classList.add("hide");
|
||||
|
||||
subtitleSyncTextField.updateOffset = function(offset) {
|
||||
@ -87,8 +96,6 @@ define(['playbackManager', 'text!./subtitlesync.template.html', 'css!./subtitles
|
||||
SubtitleSync.prototype.toggle("forceToHide");
|
||||
});
|
||||
|
||||
document.body.appendChild(parent);
|
||||
|
||||
instance.element = parent;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user