update
This commit is contained in:
+10
-5
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user