aboutsummaryrefslogtreecommitdiff
path: root/src/app/toast.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/toast.js')
-rw-r--r--src/app/toast.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/app/toast.js b/src/app/toast.js
index 9cb8996..3bc1745 100644
--- a/src/app/toast.js
+++ b/src/app/toast.js
@@ -3,6 +3,7 @@ function Toast(properties) {
fg: "#000000",
bg: "#FFFFFF",
timeout: 3000,
+ callback: () => {},
title: "Untitled Toast",
description: "No description provided for toast",
...properties
@@ -34,7 +35,10 @@ function Toast(properties) {
el.style.background = toast.bg;
el.id = id;
- el.setAttribute("onclick", `dismissToast(${id})`);
+ el.addEventListener("click", () => {
+ dismissToast(id);
+ toast.callback();
+ })
el.innerHTML = `
<div class="title">${toast.title}</div>