jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js

24 lines
514 B
JavaScript
Raw Normal View History

2016-02-04 13:51:13 -07:00
define([], function () {
return function (options) {
return new Promise(function (resolve, reject) {
if (typeof options === 'string') {
options = {
2016-02-15 11:15:08 -07:00
label: '',
2016-02-04 13:51:13 -07:00
text: options
};
}
2016-02-15 11:15:08 -07:00
var result = prompt(options.label || '', options.text || '');
2016-02-04 13:51:13 -07:00
if (result) {
resolve(result);
} else {
reject(result);
}
});
};
});