Milk Admin

Template: modal

Manages the template modal.

<button class="btn btn-primary" onclick="exShowModal()">Show Modal</button>
<script> 
function exShowModal() { 
window.modal.show('Show modal', 'This is the body of the modal', 'footer'); 
}
</script>
The close button in the footer is written like this:
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>


Properties

The Modal class is instantiated in window.modal and provides the following methods:

  • show(title, body, footer) - shows the modal
  • hide() - hides the message
  • title(html) - sets the title of the modal
  • body(html) - sets the content of the modal
  • footer(html) - sets the footer of the modal
Loading...