Script47 / Toast

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

Add the option to set a container for the toast. #10

Closed draane closed 5 years ago

draane commented 5 years ago

I added the option to set a container different from the body. The container option must be a JQuery selector with length 1. Not sure if this is the best implementation, an other option could be the string of the id, but this require the element to have an id.

This can be useful if I do not want the toast to go over an element. For example I don't want the toast to be over the navigation topbar, so I set the container to the main content.

To achieve this, i changed TOAST_CONTAINER_HTML and TOAST_WRAPPER_HTML, removing the id and adding a class, because if I create a toast in 2 different containers the ids would be duplicated.

I also created an example, but its graphic might be not ideal.

Script47 commented 5 years ago

@draane

FYI: I have seen this, I've just been busy, I'll get around to this some time this week.