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

32 lines
702 B
JavaScript
Raw Normal View History

2016-07-20 09:56:24 -04:00
define(['dialog', 'globalize'], function (dialog, globalize) {
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({
name: globalize.translate('sharedcomponents#ButtonOk'),
id: 'ok'
});
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) {
if (result == 'ok') {
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
});
};
});