pianello-api/resources/js/pages/modal/index.js
Ale Gallo 82f958e5da Committing laravel (part 3)
committing js templating files and components
2023-11-10 16:00:59 +01:00

24 lines
780 B
JavaScript

(function () {
"use strict";
// Show modal
$("#programmatically-show-modal").on("click", function () {
const el = document.querySelector("#programmatically-modal");
const modal = tailwind.Modal.getOrCreateInstance(el);
modal.show();
});
// Hide modal
$("#programmatically-hide-modal").on("click", function () {
const el = document.querySelector("#programmatically-modal");
const modal = tailwind.Modal.getOrCreateInstance(el);
modal.hide();
});
// Toggle modal
$("#programmatically-toggle-modal").on("click", function () {
const el = document.querySelector("#programmatically-modal");
const modal = tailwind.Modal.getOrCreateInstance(el);
modal.toggle();
});
})();