mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
7ebc536076
commit
a1af156757
65 changed files with 2335 additions and 262 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'scrollHelper', 'dom', 'css!./dialoghelper.css', 'scrollStyles'], function (historyManager, focusManager, browser, layoutManager, inputManager, scrollHelper, dom) {
|
||||
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'dom', 'css!./dialoghelper.css', 'scrollStyles'], function (historyManager, focusManager, browser, layoutManager, inputManager, dom) {
|
||||
|
||||
var globalOnOpenCallback;
|
||||
|
||||
|
@ -15,6 +15,18 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function removeCenterFocus(dlg) {
|
||||
|
||||
if (layoutManager.tv) {
|
||||
if (dlg.classList.contains('smoothScrollX')) {
|
||||
centerFocus(dlg, true, false);
|
||||
}
|
||||
else if (dlg.classList.contains('smoothScrollY')) {
|
||||
centerFocus(dlg, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function dialogHashHandler(dlg, hash, resolve) {
|
||||
|
||||
var self = this;
|
||||
|
@ -70,6 +82,7 @@
|
|||
activeElement.focus();
|
||||
|
||||
if (dlg.getAttribute('data-removeonclose') == 'true') {
|
||||
removeCenterFocus(dlg);
|
||||
dlg.parentNode.removeChild(dlg);
|
||||
}
|
||||
|
||||
|
@ -358,6 +371,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
function centerFocus(elem, horiz, on) {
|
||||
require(['scrollHelper'], function (scrollHelper) {
|
||||
var fn = on ? 'on' : 'off';
|
||||
scrollHelper.centerFocus[fn](elem, horiz);
|
||||
});
|
||||
}
|
||||
|
||||
function createDialog(options) {
|
||||
|
||||
options = options || {};
|
||||
|
@ -438,14 +458,14 @@
|
|||
dlg.classList.add('smoothScrollX');
|
||||
|
||||
if (layoutManager.tv) {
|
||||
scrollHelper.centerFocus.on(dlg, true);
|
||||
centerFocus(dlg, true, true);
|
||||
}
|
||||
}
|
||||
else if (options.scrollY !== false) {
|
||||
dlg.classList.add('smoothScrollY');
|
||||
|
||||
if (layoutManager.tv) {
|
||||
scrollHelper.centerFocus.on(dlg, false);
|
||||
centerFocus(dlg, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue