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

Add text essage into snackbar #18

Open
machao81 opened this issue Oct 18, 2018 · 2 comments
Open

Add text essage into snackbar #18

machao81 opened this issue Oct 18, 2018 · 2 comments

Comments

@machao81
Copy link

Could you modify the showsnackbar method to pass in parameter the text of the snackbar ?

showsnackbar( ID, "my new text" )

@ramdeoshubham
Copy link
Member

This one is nice idea! Sure!! I will comment back after adding that! 😀

@machao81
Copy link
Author

machao81 commented Oct 23, 2018

I use this if it can help you.

toast = function(text, options )
{
let newDiv = document.createElement("div");
newDiv.setAttribute("class","snackbar _primary show "+ options );
newDiv.appendChild(document.createTextNode(text));
document.body.appendChild(newDiv);
setTimeout(function(){ document.body.removeChild(newDiv); },3E3);
};

The timeout can be another parameter.

Last thing about toast that is the toasts are displayed one on top of the other... You need to implements something to display a second toast at the bottom of the first one.

Anyway, I really like your framework. Keep going!

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

No branches or pull requests

2 participants