CodeSeven / toastr

Simple javascript toast notifications

Home Page:http://www.toastrjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: Control the parent container of the toast

noamyg opened this issue · comments

Just an idea that would make life much easier.
When you want to customise the toast location, it's possible to change the positionClass. However, the #toast-container always adds itself to body and is fixed at window-level.

It'd be really nice to have something like baseLocationSelector that defaults to body . I.E. If I wanted to have the toast fixed to the bottom of a div <div id="popup-div"> then I could say toastr.success(null, title, { baseLocationSelector : "#popup-div", positionClass: "toast-bottom-full-width" });

Overriding baseLocationSelector would change the position of the toast from fixed to absolute and the surrounding container would have to be relative for it to work properly.