This commit is contained in:
chenyang
2022-07-09 07:16:00 +08:00
parent e56e321d5b
commit 20df0416db
4 changed files with 24 additions and 7 deletions
+10 -5
View File
@@ -2,8 +2,11 @@ function common_alert(text, class_str) {
if (!class_str) {
class_str = 'alert-warning'
}
// reset
$('.alert').alert('close')
// reset bootstrap.bundle.js 里的方法
const bundle_alert = typeof ($('.alert').alert) === 'function'
if (bundle_alert) {
$('.alert').alert('close')
}
// content
const content = `
<div class="alert ${class_str} fade show" role="alert" style="z-index: 2000;position: absolute;top: 0;width: calc(100%);">
@@ -12,9 +15,11 @@ function common_alert(text, class_str) {
// append
$('body').append(content)
// clean
setTimeout(function () {
$('.alert').alert('close')
}, 1500)
if (bundle_alert) {
setTimeout(function () {
$('.alert').alert('close')
}, 1500)
}
}
function primary_alert(text) {