mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update dialogs
This commit is contained in:
parent
091d4e96b7
commit
512a8ee8d1
2 changed files with 14 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['paperdialoghelper', 'paper-menu', 'paper-dialog', 'scale-up-animation', 'fade-out-animation'], function (paperDialogHelper) {
|
||||
define(['paperdialoghelper', 'browser', 'paper-menu', 'paper-dialog', 'scale-up-animation', 'fade-out-animation'], function (paperDialogHelper, browser) {
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
||||
|
@ -127,7 +127,7 @@
|
|||
});
|
||||
|
||||
// Seeing an issue in some non-chrome browsers where this is requiring a double click
|
||||
var eventName = browserInfo.firefox ? 'mousedown' : 'click';
|
||||
var eventName = browser.firefox ? 'mousedown' : 'click';
|
||||
|
||||
dlg.addEventListener(eventName, function (e) {
|
||||
|
||||
|
|
|
@ -565,10 +565,13 @@ var Dashboard = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Cordova
|
||||
if (navigator.notification && navigator.notification.alert && options.message.indexOf('<') == -1) {
|
||||
if (browserInfo.mobile && options.message.indexOf('<') == -1) {
|
||||
|
||||
navigator.notification.alert(options.message, options.callback || function () { }, options.title || Globalize.translate('HeaderAlert'));
|
||||
alert(options.message);
|
||||
|
||||
if (options.callback) {
|
||||
options.callback();
|
||||
}
|
||||
|
||||
} else {
|
||||
require(['paper-dialog', 'fade-in-animation', 'fade-out-animation'], function () {
|
||||
|
@ -580,15 +583,13 @@ var Dashboard = {
|
|||
confirm: function (message, title, callback) {
|
||||
|
||||
// Cordova
|
||||
if (navigator.notification && navigator.notification.confirm && message.indexOf('<') == -1) {
|
||||
if (browserInfo.mobile && message.indexOf('<') == -1) {
|
||||
|
||||
var buttonLabels = [Globalize.translate('ButtonOk'), Globalize.translate('ButtonCancel')];
|
||||
var confirmed = confirm(message);
|
||||
|
||||
navigator.notification.confirm(message, function (index) {
|
||||
|
||||
callback(index == 1);
|
||||
|
||||
}, title || Globalize.translate('HeaderConfirm'), buttonLabels.join(','));
|
||||
if (callback) {
|
||||
callback(confirmed);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -1876,13 +1877,11 @@ var AppInfo = {};
|
|||
paths.hlsjs = bowerPath + "/hls.js/dist/hls.min";
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
paths.dialog = "cordova/dialog";
|
||||
paths.sharingwidget = "cordova/sharingwidget";
|
||||
paths.serverdiscovery = "cordova/serverdiscovery";
|
||||
paths.wakeonlan = "cordova/wakeonlan";
|
||||
paths.actionsheet = "cordova/actionsheet";
|
||||
} else {
|
||||
paths.dialog = "components/dialog";
|
||||
paths.sharingwidget = "components/sharingwidget";
|
||||
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
|
||||
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
|
||||
|
@ -2046,9 +2045,7 @@ var AppInfo = {};
|
|||
|
||||
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
define("prompt", ["cordova/prompt"], returnFirstDependency);
|
||||
} else if (browser.mobile) {
|
||||
if (browser.mobile) {
|
||||
define("prompt", [embyWebComponentsBowerPath + "/prompt/nativeprompt"], returnFirstDependency);
|
||||
} else {
|
||||
define("prompt", [embyWebComponentsBowerPath + "/prompt/prompt"], returnFirstDependency);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue