Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 1 | <button id="demo-show-toast" class="mdl-button mdl-js-button mdl-button--raised" type="button">Show Toast</button> |
| 2 | <div id="demo-toast-example" class="mdl-js-snackbar mdl-snackbar"> |
| 3 | <div class="mdl-snackbar__text"></div> |
| 4 | <button class="mdl-snackbar__action" type="button"></button> |
| 5 | </div> |
| 6 | <script> |
| 7 | (function() { |
| 8 | 'use strict'; |
| 9 | window['counter'] = 0; |
| 10 | var snackbarContainer = document.querySelector('#demo-toast-example'); |
| 11 | var showToastButton = document.querySelector('#demo-show-toast'); |
| 12 | showToastButton.addEventListener('click', function() { |
| 13 | 'use strict'; |
| 14 | var data = {message: 'Example Message # ' + ++counter}; |
| 15 | snackbarContainer.MaterialSnackbar.showSnackbar(data); |
| 16 | }); |
| 17 | }()); |
| 18 | </script> |