mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #2155 from thornbill/quickconnect-enhancements
Improve QuickConnect ux
This commit is contained in:
commit
c383c8075a
9 changed files with 92 additions and 60 deletions
|
@ -13,10 +13,11 @@ import template from './dialog.template.html';
|
|||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function showDialog(options) {
|
||||
function showDialog(options = { dialogOptions: {}, buttons: [] }) {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
scrollY: false,
|
||||
...options.dialogOptions
|
||||
};
|
||||
|
||||
const enableTvLayout = layoutManager.tv;
|
||||
|
|
|
@ -360,14 +360,17 @@ import '../../assets/css/scrollstyles.css';
|
|||
});
|
||||
}
|
||||
|
||||
export function createDialog(options) {
|
||||
options = options || {};
|
||||
|
||||
export function createDialog(options = {}) {
|
||||
// If there's no native dialog support, use a plain div
|
||||
// Also not working well in samsung tizen browser, content inside not clickable
|
||||
// Just go ahead and always use a plain div because we're seeing issues overlaying absoltutely positioned content over a modal dialog
|
||||
const dlg = document.createElement('div');
|
||||
|
||||
// Add an id so we can access the dialog element
|
||||
if (options.id) {
|
||||
dlg.id = options.id;
|
||||
}
|
||||
|
||||
dlg.classList.add('focuscontainer');
|
||||
dlg.classList.add('hide');
|
||||
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
import globalize from '../../scripts/globalize';
|
||||
import toast from '../toast/toast';
|
||||
import Dashboard from '../../scripts/clientUtils';
|
||||
|
||||
export class QuickConnectSettings {
|
||||
constructor() { }
|
||||
|
||||
authorize(code) {
|
||||
const url = ApiClient.getUrl('/QuickConnect/Authorize?Code=' + code);
|
||||
ApiClient.ajax({
|
||||
type: 'POST',
|
||||
url: url
|
||||
}, true).then(() => {
|
||||
toast(globalize.translate('QuickConnectAuthorizeSuccess'));
|
||||
}).catch(() => {
|
||||
toast(globalize.translate('QuickConnectAuthorizeFail'));
|
||||
});
|
||||
|
||||
// prevent bubbling
|
||||
return false;
|
||||
}
|
||||
|
||||
activate() {
|
||||
const url = ApiClient.getUrl('/QuickConnect/Activate');
|
||||
return ApiClient.ajax({
|
||||
type: 'POST',
|
||||
url: url
|
||||
}).then(() => {
|
||||
toast(globalize.translate('QuickConnectActivationSuccessful'));
|
||||
return true;
|
||||
}).catch((e) => {
|
||||
console.error('Error activating quick connect. Error:', e);
|
||||
Dashboard.alert({
|
||||
title: globalize.translate('HeaderError'),
|
||||
message: globalize.translate('DefaultErrorMessage')
|
||||
});
|
||||
throw e;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default QuickConnectSettings;
|
Loading…
Add table
Add a link
Reference in a new issue