chg: [js:bootstrap-helper] Allow closing success toast without title
parent
e98290fcba
commit
0c4a73cc39
|
@ -350,18 +350,16 @@ class Toaster {
|
||||||
$toast.attr('id', options.id)
|
$toast.attr('id', options.id)
|
||||||
}
|
}
|
||||||
$toast.addClass('toast-' + options.variant)
|
$toast.addClass('toast-' + options.variant)
|
||||||
if (options.title !== false || options.titleHtml !== false || options.muted !== false || options.mutedHtml !== false) {
|
if (options.title !== false || options.titleHtml !== false || options.muted !== false || options.mutedHtml !== false || options.closeButton) {
|
||||||
var $toastHeader = $('<div class="toast-header"/>')
|
var $toastHeader = $('<div class="toast-header"/>')
|
||||||
$toastHeader.addClass('toast-' + options.variant)
|
$toastHeader.addClass('toast-' + options.variant)
|
||||||
if (options.title !== false || options.titleHtml !== false) {
|
let $toastHeaderText = $('<span class="me-auto"/>')
|
||||||
var $toastHeaderText
|
|
||||||
if (options.titleHtml !== false) {
|
if (options.titleHtml !== false) {
|
||||||
$toastHeaderText = $('<div class="me-auto"/>').html(options.titleHtml);
|
$toastHeaderText = $('<div class="me-auto"/>').html(options.titleHtml);
|
||||||
} else {
|
} else if (options.title !== false) {
|
||||||
$toastHeaderText = $('<strong class="me-auto"/>').text(options.title)
|
$toastHeaderText = $('<strong class="me-auto"/>').text(options.title)
|
||||||
}
|
}
|
||||||
$toastHeader.append($toastHeaderText)
|
$toastHeader.append($toastHeaderText)
|
||||||
}
|
|
||||||
if (options.muted !== false || options.mutedHtml !== false) {
|
if (options.muted !== false || options.mutedHtml !== false) {
|
||||||
var $toastHeaderMuted
|
var $toastHeaderMuted
|
||||||
if (options.mutedHtml !== false) {
|
if (options.mutedHtml !== false) {
|
||||||
|
|
Loading…
Reference in New Issue