diff --git a/toasts.html b/toasts.html index 214ddd1..d7e10f5 100644 --- a/toasts.html +++ b/toasts.html @@ -64,34 +64,12 @@

Options

The content of the Toast. - unsafeHTML - String, HTMLElement - '' - - HTML content that will be appended to to - text. Only use - properly sanitized or otherwise trusted data for - unsafeHTML. - - - - html + toastId String ''

- (DEPRECATED): will be removed in a later release. -

-

- HTML content that will be appended to - text. Only use - properly sanitized or otherwise trusted data for - html. -

-

- Will be ignored if - unsafeHTML is - set. + Id of an HTML element that will be used as tootip content.

@@ -180,27 +158,34 @@

Properties

Custom HTML

- You can pass in an HTML String as the first argument as well. - Take a look at the example below, where we pass in text as well - as a flat button. If you call an external function instead of - in-line JavaScript, you will not need to escape quotation marks. -

-

- Only use a properly sanitized or otherwise trusted HTML string. -

+ You can pass in an toastId as the argument as well. + This toastId should refer to some element in the HTML that will be used as toast content. +

-

-  var toastHTML = '<span>I am toast content</span><button class="btn-flat toast-action">Undo</button>';
-  M.toast({unsafeHTML: toastHTML});
-        
+ + + +

+<button type="button" class="btn" onclick="M.toast({toastId: 'my-toast-1'})">Toast 2!</button>
+<div id="my-toast-1" style="display: none;">
+  This is toast nº1 with a <a href="https://github.com/materializecss">link</a>
+</div>
-

Callback