mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix dialogs
This commit is contained in:
parent
29f295b69c
commit
d08ee04bdb
10 changed files with 113 additions and 70 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, layoutManager, scrollHelper, globalize, require) {
|
||||
define(['dialogHelper', 'dom', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, dom, layoutManager, scrollHelper, globalize, require) {
|
||||
|
||||
function showTvDialog(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
@ -65,6 +65,8 @@ define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'require',
|
|||
html += '<button is="emby-button" type="button" class="' + buttonClass + '" data-id="' + item.id + '"' + autoFocus + '>' + item.name + '</button>';
|
||||
}
|
||||
|
||||
dlg.style.minWidth = (Math.min(options.buttons.length * 150, dom.getWindowSize().innerWidth - 50)) + 'px';
|
||||
|
||||
dlg.querySelector('.formDialogFooter').innerHTML = html;
|
||||
|
||||
var dialogResult;
|
||||
|
|
|
@ -149,7 +149,7 @@
|
|||
}, 0);
|
||||
|
||||
dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) {
|
||||
if (!isParent(dlg, e.target)) {
|
||||
if (e.target == dlg.dialogContainer) {
|
||||
close(dlg);
|
||||
}
|
||||
}, {
|
||||
|
@ -157,20 +157,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
function isParent(parent, child) {
|
||||
|
||||
while (child) {
|
||||
|
||||
if (child == parent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
child = child.parentNode;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isHistoryEnabled(dlg) {
|
||||
return dlg.getAttribute('data-history') == 'true';
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
}
|
||||
|
||||
.formDialogHeader, .formDialogFooter {
|
||||
background-color: #1D1E21;
|
||||
background-color: #222326;
|
||||
}
|
||||
|
||||
.formDialogHeaderTitle {
|
||||
|
|
|
@ -357,6 +357,11 @@
|
|||
|
||||
});
|
||||
|
||||
context.querySelector('.btnHeaderSave').addEventListener('click', function (e) {
|
||||
|
||||
context.querySelector('.btnSave').click();
|
||||
});
|
||||
|
||||
context.querySelector('#chkLockData').addEventListener('click', function (e) {
|
||||
|
||||
if (!e.target.checked) {
|
||||
|
@ -1208,6 +1213,8 @@
|
|||
|
||||
elem.innerHTML = globalize.translateDocument(template, 'sharedcomponents');
|
||||
|
||||
elem.querySelector('.formDialogFooter').classList.remove('formDialogFooter');
|
||||
elem.querySelector('.btnHeaderSave').classList.remove('hide');
|
||||
elem.querySelector('.btnCancel').classList.add('hide');
|
||||
|
||||
currentContext = elem;
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
${Edit}
|
||||
</h3>
|
||||
<div style="margin-left: auto; display: flex; align-items: center; justify-content: center;">
|
||||
<button is="emby-button" type="button" class="btnHeaderSave button-accent-flat hide" tabindex="-1">
|
||||
<i class="md-icon">check</i>
|
||||
<span>${Save}</span>
|
||||
</button>
|
||||
<button is="paper-icon-button-light" class="btnMore autoSize" tabindex="-1">
|
||||
<i class="md-icon">more_vert</i>
|
||||
</button>
|
||||
|
|
|
@ -397,7 +397,7 @@
|
|||
html += globalize.translate('sharedcomponents#Sync');
|
||||
html += '</h3>';
|
||||
|
||||
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink lnkHelp" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:auto;"><button is="emby-button" type="button" class="mini"><i class="md-icon">info</i><span>' + globalize.translate('sharedcomponents#Help') + '</span></button></a>';
|
||||
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink lnkHelp" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:auto;"><button is="emby-button" type="button" class="button-accent-flat"><i class="md-icon">info</i><span>' + globalize.translate('sharedcomponents#Help') + '</span></button></a>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue