jellyfish-web/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js

15 lines
426 B
JavaScript
Raw Normal View History

2018-10-23 01:05:09 +03:00
define([], function() {
"use strict";
function replaceAll(str, find, replace) {
return str.split(find).join(replace)
}
return function(options) {
"string" == typeof options && (options = {
title: "",
text: options
});
var text = replaceAll(options.text || "", "<br/>", "\n");
return confirm(text) ? Promise.resolve() : Promise.reject()
}
});