1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/alert/alert.js

34 lines
752 B
JavaScript
Raw Normal View History

2016-07-20 09:56:24 -04:00
define(['dialog', 'globalize'], function (dialog, globalize) {
2016-10-02 02:46:32 -04:00
'use strict';
2016-05-06 13:49:58 -04:00
2016-07-20 09:56:24 -04:00
return function (text, title) {
2016-05-06 13:49:58 -04:00
2016-07-20 09:56:24 -04:00
var options;
if (typeof text === 'string') {
2016-02-26 15:29:27 -05:00
options = {
2016-07-20 09:56:24 -04:00
title: title,
text: text
2016-02-26 15:29:27 -05:00
};
} else {
2016-07-20 09:56:24 -04:00
options = text;
2016-02-26 15:29:27 -05:00
}
2016-07-20 09:56:24 -04:00
var items = [];
2016-02-26 15:29:27 -05:00
2016-07-20 09:56:24 -04:00
items.push({
2016-09-12 14:10:09 -04:00
name: globalize.translate('sharedcomponents#ButtonGotIt'),
2016-09-09 02:59:23 -04:00
id: 'ok',
type: 'submit'
2016-07-20 09:56:24 -04:00
});
2016-04-09 22:27:09 -04:00
2016-07-20 09:56:24 -04:00
options.buttons = items;
2016-02-26 15:29:27 -05:00
2016-07-20 09:56:24 -04:00
return dialog(options).then(function (result) {
2016-10-02 02:46:32 -04:00
if (result === 'ok') {
2016-07-20 09:56:24 -04:00
return Promise.resolve();
2016-02-26 15:29:27 -05:00
}
2016-07-20 09:56:24 -04:00
return Promise.reject();
2016-02-26 15:29:27 -05:00
});
};
});