Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for explicitly clearing a toast, which ignores the focus c... #226

Merged
merged 3 commits into from
Jan 20, 2015

Conversation

jstawski
Copy link
Contributor

I added a new clearExplicitly function that clears the toast without checking for focused elements. The idea is to give full control to the developer if they want to clear the toast regardless of focus! More info on issue #220 .

@TimFerrell
Copy link
Member

Can this be done as toastr.clear(true), where the override is the first parameter of the clear function?

Truth would indicate a forced clear, falsiness/null would indicate legacy functionality.

@TimFerrell
Copy link
Member

Alternately, passing in an object with parameters stating the explicit clear?

@jstawski
Copy link
Contributor Author

toastr.clear already takes in $toastElement. We wanted backwards compatibility so if we want to "overload" then an options parameter would be the way to go. Will make the changes...

@jstawski
Copy link
Contributor Author

The new commit uses an option object on the clear function. The only used option is ignoreFocus

toastr.clear($toast, { ignoreFocus: true });

@jstawski
Copy link
Contributor Author

Any word on this PR?

@johnpapa
Copy link
Member

I like it. Name the argument force instead of ignoreFocus though.

@jstawski
Copy link
Contributor Author

Renamed.

johnpapa added a commit that referenced this pull request Jan 20, 2015
Added support for explicitly clearing a toast, which ignores the focus c...
@johnpapa johnpapa merged commit 779d003 into CodeSeven:master Jan 20, 2015
@johnpapa
Copy link
Member

thanks

@TimFerrell
Copy link
Member

thanks @jstawski

@jstawski jstawski deleted the clearExplicitly branch October 19, 2015 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants