MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / showToast

Function showToast

ts/base_ts.ts:93–118  ·  view source on GitHub ↗
(title: string, message: string, type: string = 'info')

Source from the content-addressed store, hash-verified

91}
92
93function showToast(title: string, message: string, type: string = 'info') {
94 const toast = document.getElementById('toast');
95 const toastBody = document.getElementById('toast-body');
96
97 if (toastBody && toast) {
98 toastBody.textContent = message;
99
100 // Remove existing classes and add new type class
101 toast.className = 'toast';
102 if (type === 'success') {
103 toast.classList.add('text-bg-success');
104 } else if (type === 'error') {
105 toast.classList.add('text-bg-danger');
106 } else if (type === 'warning') {
107 toast.classList.add('text-bg-orange');
108 } else {
109 toast.classList.add('text-bg-info');
110 }
111
112 const bsToast = new bootstrap.Toast(toast, {
113 autohide: true,
114 delay: 3000
115 });
116 bsToast.show();
117 }
118}
119
120function changeButtonAction(element, buttonID, attribute) {
121 var value = element.options[element.selectedIndex].value;

Callers 2

initWebSocketFunction · 0.70
savePopupDataFunction · 0.70

Calls 1

showMethod · 0.45

Tested by

no test coverage detected