fastruby/points

View on GitHub
app/assets/javascripts/modal.js

Summary

Maintainability
A
0 mins
Test Coverage
let modal = false
document.addEventListener("turbolinks:load", () => {
  modal = document.querySelector(".modal")
})

// show a new Modal with a given title and body
function showModal(title, body) {
  updateModal(title, body)
  $(modal).modal('show')
}

// update the Modal title and body
function updateModal(title, body) {
  modal.querySelector(".modal-title").innerHTML = title
  modal.querySelector(".modal-body").innerHTML = body
}

// closes the modal
function closeModal() {
  $(modal).modal('hide')
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.