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,11 @@
|
|||
define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'paper-icon-button-light', 'emby-input', 'emby-select', 'css!./../formdialog'], function (dialogHelper, layoutManager, scrollHelper, globalize, require) {
|
||||
define(['dialogHelper', 'layoutManager', 'globalize', 'require', 'paper-icon-button-light', 'emby-input', 'emby-select', 'css!./../formdialog'], function (dialogHelper, layoutManager, globalize, require) {
|
||||
|
||||
function centerFocus(elem, horiz, on) {
|
||||
require(['scrollHelper'], function (scrollHelper) {
|
||||
var fn = on ? 'on' : 'off';
|
||||
scrollHelper.centerFocus[fn](elem, horiz);
|
||||
});
|
||||
}
|
||||
|
||||
function show(person) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
@ -6,7 +13,8 @@
|
|||
require(['text!./personeditor.template.html'], function (template) {
|
||||
|
||||
var dialogOptions = {
|
||||
removeOnClose: true
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
};
|
||||
|
||||
if (layoutManager.tv) {
|
||||
|
@ -25,7 +33,7 @@
|
|||
var html = '';
|
||||
var submitted = false;
|
||||
|
||||
html += globalize.translateDocument(template);
|
||||
html += globalize.translateDocument(template, 'metadataeditor');
|
||||
|
||||
dlg.innerHTML = html;
|
||||
document.body.appendChild(dlg);
|
||||
|
@ -35,13 +43,17 @@
|
|||
dlg.querySelector('.txtPersonRole', dlg).value = person.Role || '';
|
||||
|
||||
if (layoutManager.tv) {
|
||||
scrollHelper.centerFocus.on(dlg.querySelector('.dialogContent'), false);
|
||||
centerFocus(dlg.querySelector('.dialogContent'), false, true);
|
||||
}
|
||||
|
||||
dialogHelper.open(dlg);
|
||||
|
||||
dlg.addEventListener('close', function () {
|
||||
|
||||
if (layoutManager.tv) {
|
||||
centerFocus(dlg.querySelector('.dialogContent'), false, false);
|
||||
}
|
||||
|
||||
if (submitted) {
|
||||
resolve(person);
|
||||
} else {
|
||||
|
@ -72,6 +84,12 @@
|
|||
}
|
||||
|
||||
return {
|
||||
show: show
|
||||
show: function (person) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
return globalize.loadStrings('metadataeditor').then(function () {
|
||||
return show(person);
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue