Script47 / Toast

A Bootstrap 4.2+ jQuery plugin for the toast component
https://shrtn.onl/EY
MIT License
152 stars 43 forks source link

Fixes #1. New option to allow delay to be disabled #2

Closed tip2tail closed 5 years ago

tip2tail commented 5 years ago

As per the issue I raised, this PR will introduce the ability to disable the autohide functionality on Toast.

Setting delay to -1 will result in a Toast that will stay open until closed using the "x" close button.

Script47 commented 5 years ago

@tip2tail,

Can you also include an updated min.js, I've been using: https://closure-compiler.appspot.com/home

Also, I'm wondering if we should make the default delay to -1 so toasts by default don't disappear unless you specify. Makes it easier to keep them permanent and if we do go down this route, it might make more sense just to change it so if the delay parameter is passed then we hide after X amount of time and if the delay parameter is not passed we keep it showing until manually dismissed.

Thoughts?

tip2tail commented 5 years ago

Hi @Script47. I did update the .min.js file but used a different compress tool. I will use the one you mention in order to keep this constant. What settings did you select for this?

As for your proposal of default to stay open, I think that is a very good idea. I can refine this pull request to fix that just now and resubmit shortly.

Thanks (y)

tip2tail commented 5 years ago

@Script47 I would also suggest we provide the timeout in seconds rather than miliseconds (and convert to miliseconds in the script).

Script47 commented 5 years ago

My bad, I must have missed the min.js changes!

Regarding the settings for the tool, I left them as is.

Regarding timeout in seconds, my only contention would that would be that JavaScript seems to handle things in milliseconds and for the sake of consistency I'd leave it.

tip2tail commented 5 years ago

OK happy to leave that as milliseconds. Will have an updated PR shortly.

tip2tail commented 5 years ago

@Script47 PR has been updated with changes as discussed.