Open machao81 opened 6 years ago
This one is nice idea! Sure!! I will comment back after adding that! 😀
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!
Could you modify the showsnackbar method to pass in parameter the text of the snackbar ?
showsnackbar( ID, "my new text" )