tingle.js
In this section, let's see an example of working with modal windows tingle.js.
Opening a modal
If you have the task of opening a modal window after a successful form submission, it can be solved in two ways:
Using the
fetchit:success
event.jsconst successModal = new tingle.modal(); document.addEventListener('fetchit:success', ({ detail: { response: { message } } }) => { successModal.setContent(message); successModal.open(); });
With
FetchIt.Message
.jsconst successModal = new tingle.modal(); FetchIt.Message = { // ... success (message) { successModal.setContent(message); successModal.open(); }, }