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/confirm/confirm.js

37 lines
833 B
JavaScript
Raw Normal View History

2016-07-20 02:23:18 -04:00
define(['dialog', 'globalize'], function (dialog, globalize) {
2016-02-22 13:25:45 -05:00
2016-02-22 14:31:28 -05:00
return function (text, title) {
2016-02-22 13:25:45 -05:00
2016-02-22 14:31:28 -05:00
var options;
if (typeof text === 'string') {
2016-02-22 13:25:45 -05:00
options = {
2016-02-22 14:31:28 -05:00
title: title,
text: text
2016-02-22 13:25:45 -05:00
};
2016-02-22 14:31:28 -05:00
} else {
options = text;
2016-02-22 13:25:45 -05:00
}
2016-07-20 02:23:18 -04:00
var items = [];
items.push({
name: globalize.translate('sharedcomponents#ButtonOk'),
id: 'ok'
});
2016-02-22 13:25:45 -05:00
2016-07-20 02:23:18 -04:00
items.push({
name: globalize.translate('sharedcomponents#ButtonCancel'),
id: 'cancel'
});
options.buttons = items;
return dialog(options).then(function (result) {
if (result == 'ok') {
return Promise.resolve();
}
return Promise.reject();
});
2016-02-22 13:25:45 -05:00
};
});