chrisgo / bootstrap5-toast

Makes Bootstrap 5.x Toasts easier to use
8 stars 4 forks source link

Delay not working because wrong attribute #3

Closed mxmihai closed 2 years ago

mxmihai commented 2 years ago

Maybe the delay shoule be more flexible.

instead of:

    let delayOrAutohide = opts.delay ? `data-delay="${opts.delay}"` : `data-autohide="false"`;

maybe:

    let delayOrAutohide = opts.delay ? `data-delay="${opts.delay}"` : `data-bs-autohide="false"`;
mxmihai commented 2 years ago

also, instead of:

delayOrAutohide = `data-autohide="false"`;

it should be:

delayOrAutohide = `data-bs-autohide="false"`;
mxmihai commented 2 years ago

also, instead of:

if ($.toastDefaults.pauseDelayOnHover) {

it shoudl be:

if ($.toastDefaults.pauseDelayOnHover && opts.delay) {
chrisgo commented 2 years ago

@mxmihai thank you for hunting this down, I was just getting back to this and found these problems and you already got the code ready :)

In addition to the items here (plus #1 and #2), also fixed 2 more