Skip to content

Commit ed7ba6b

Browse files
authored
Merge pull request #1 from danice/main
fix for Toast page onclick event not working: M was not accessible from html onclick events
2 parents 92d73a8 + e38e9ef commit ed7ba6b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import "./style.scss";
44
import "prismjs/themes/prism.min.css";
55
import { config } from "../config.materialize";
66

7+
globalThis.M = M
8+
79
document.addEventListener("DOMContentLoaded", function() {
810
function rgb2hex(rgb: string) {
911
if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb;

toasts.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<button
2121
type="button"
2222
class="waves-effect waves-light btn"
23-
onclick="M.toast({text: 'I am a toast'})"
23+
onclick="M.toast({text: 'I am a toast', classes: 'primary'})"
2424
>
2525
Toast!
2626
</button>

0 commit comments

Comments
 (0)