MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / showToast

Function showToast

html/js/base_ts.js:78–103  ·  view source on GitHub ↗
(title, message, type = 'info')

Source from the content-addressed store, hash-verified

76 }
77}
78function showToast(title, message, type = 'info') {
79 const toast = document.getElementById('toast');
80 const toastBody = document.getElementById('toast-body');
81 if (toastBody && toast) {
82 toastBody.textContent = message;
83 // Remove existing classes and add new type class
84 toast.className = 'toast';
85 if (type === 'success') {
86 toast.classList.add('text-bg-success');
87 }
88 else if (type === 'error') {
89 toast.classList.add('text-bg-danger');
90 }
91 else if (type === 'warning') {
92 toast.classList.add('text-bg-orange');
93 }
94 else {
95 toast.classList.add('text-bg-info');
96 }
97 const bsToast = new bootstrap.Toast(toast, {
98 autohide: true,
99 delay: 3000
100 });
101 bsToast.show();
102 }
103}
104function changeButtonAction(element, buttonID, attribute) {
105 var value = element.options[element.selectedIndex].value;
106 document.getElementById(buttonID).setAttribute(attribute, value);

Callers 2

initWebSocketFunction · 0.70
savePopupDataFunction · 0.70

Calls 1

showMethod · 0.45

Tested by

no test coverage detected