mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update shared components
This commit is contained in:
parent
912bd57ca0
commit
39fe608c2d
7 changed files with 122 additions and 62 deletions
61
dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js
vendored
Normal file
61
dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
define(['layoutManager', 'dialogText'], function (layoutManager, dialogText) {
|
||||
|
||||
function showTvConfirm(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['actionsheet'], function (actionSheet) {
|
||||
|
||||
var items = [];
|
||||
|
||||
items.push({
|
||||
name: dialogText.get('Ok'),
|
||||
id: 'ok'
|
||||
});
|
||||
|
||||
items.push({
|
||||
name: dialogText.get('Cancel'),
|
||||
id: 'cancel'
|
||||
});
|
||||
|
||||
actionsheet.show({
|
||||
|
||||
title: options.title,
|
||||
items: items
|
||||
|
||||
}).then(function (id) {
|
||||
|
||||
switch (id) {
|
||||
|
||||
case 'ok':
|
||||
resolve();
|
||||
break;
|
||||
default:
|
||||
reject();
|
||||
break;
|
||||
}
|
||||
|
||||
}, reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function showConfirm(options) {
|
||||
|
||||
}
|
||||
|
||||
return function (options) {
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
title: '',
|
||||
text: options
|
||||
};
|
||||
}
|
||||
|
||||
if (layoutManager.tv) {
|
||||
return showTvConfirm(options);
|
||||
}
|
||||
|
||||
return showConfirm(options);
|
||||
};
|
||||
});
|
20
dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js
vendored
Normal file
20
dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
define([], function () {
|
||||
|
||||
return function (options) {
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
title: '',
|
||||
text: options
|
||||
};
|
||||
}
|
||||
|
||||
var result = confirm(options.text);
|
||||
|
||||
if (result) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue