kamranahmedse / jquery-toast-plugin

Highly customizable jquery plugin to show toast messages
http://kamranahmed.info/toast
1.51k stars 507 forks source link

width made parametric #16

Closed davutg closed 8 years ago

davutg commented 8 years ago

Width parameter added to options. 250px default width changed to 300px. 250px is a bit narrow for iconic ones.

kamranahmedse commented 8 years ago

Thank you for taking the time to create PR. But I am sorry, I don't think we need this. Thanks though.

davutg commented 8 years ago

I thank you for this useful plugin. Maybe instead setting max-width parametric would be more helpful. As you see from the images below dynamically setting it to 350px generated a better view for me. image

BTW, calling update function and changing hideAfter param didn't work for me.

kamranahmedse commented 8 years ago

For the width, I don't think we need to do that with jquery, just add the CSS to overwride the width?!

For the hideAfter, thanks for letting me know. There is a PR for that, I am not getting enough time to review that, will merge it soon.

davutg commented 8 years ago

In css from my understanding there is a container and its class is jq-toast-wrap. IMO, For some toasts 300px is ideal , but for some toasts which we expect something like just a word , such as "Success!" it could be 200px.

Which place do you think to override it is the best in such cases?

kamranahmedse commented 8 years ago

Maybe this:

.jq-toast-wrap {
    max-width: 300px
}

instead of the applied width of 250px.

davutg commented 8 years ago

Yes, this was my underlying idea. According to my need I've some long text and short text notifications.So, 300px can't be fixed to me.

If we had an angular directive such as < Toast > we would consider creating some css, such as < Toast class="toast-wide toast-xlarge etc." >< / Toast >. For js implementation providing a parameter to adjust width is considerable. This could be a semantic expression, wide, large,xlarge,jubo etc. or a spesific number. Removing fixed width and defining a param for changing max-width param could be a better fit for many cases. I agree this is not a big case talk on it much but considerable .