|
|
@ -10,12 +10,16 @@ BI.Msg = ((function () { |
|
|
|
|
|
|
|
|
|
|
|
var toastStack = []; |
|
|
|
var toastStack = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var defaultConfig = { |
|
|
|
|
|
|
|
buttonHeight: 24, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
alert: function (title, message, callback) { |
|
|
|
alert: function (title, message, callback, config = defaultConfig) { |
|
|
|
this._show(false, title, message, callback); |
|
|
|
this._show(false, title, message, callback, config); |
|
|
|
}, |
|
|
|
}, |
|
|
|
confirm: function (title, message, callback) { |
|
|
|
confirm: function (title, message, callback, config = defaultConfig) { |
|
|
|
this._show(true, title, message, callback); |
|
|
|
this._show(true, title, message, callback, config); |
|
|
|
}, |
|
|
|
}, |
|
|
|
prompt: function (title, message, value, callback, min_width) { |
|
|
|
prompt: function (title, message, value, callback, min_width) { |
|
|
|
// BI.Msg.prompt(title, message, value, callback, min_width);
|
|
|
|
// BI.Msg.prompt(title, message, value, callback, min_width);
|
|
|
@ -74,7 +78,7 @@ BI.Msg = ((function () { |
|
|
|
toast.destroy?.(); |
|
|
|
toast.destroy?.(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
_show: function (hasCancel, title, message, callback) { |
|
|
|
_show: function (hasCancel, title, message, callback, config) { |
|
|
|
BI.isNull($mask) && ($mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ |
|
|
|
BI.isNull($mask) && ($mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ |
|
|
|
position: "absolute", |
|
|
|
position: "absolute", |
|
|
|
zIndex: BI.zIndex_tip - 2, |
|
|
|
zIndex: BI.zIndex_tip - 2, |
|
|
@ -105,8 +109,9 @@ BI.Msg = ((function () { |
|
|
|
controlItems.push({ |
|
|
|
controlItems.push({ |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.button", |
|
|
|
type: "bi.button", |
|
|
|
|
|
|
|
height: config.buttonHeight, |
|
|
|
text: BI.i18nText("BI-Basic_Cancel"), |
|
|
|
text: BI.i18nText("BI-Basic_Cancel"), |
|
|
|
level: "ignore", |
|
|
|
light: true, |
|
|
|
handler: function () { |
|
|
|
handler: function () { |
|
|
|
close(); |
|
|
|
close(); |
|
|
|
if (BI.isFunction(callback)) { |
|
|
|
if (BI.isFunction(callback)) { |
|
|
@ -119,6 +124,7 @@ BI.Msg = ((function () { |
|
|
|
controlItems.push({ |
|
|
|
controlItems.push({ |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.button", |
|
|
|
type: "bi.button", |
|
|
|
|
|
|
|
height: config.buttonHeight, |
|
|
|
text: BI.i18nText("BI-Basic_OK"), |
|
|
|
text: BI.i18nText("BI-Basic_OK"), |
|
|
|
handler: function () { |
|
|
|
handler: function () { |
|
|
|
close(); |
|
|
|
close(); |
|
|
|