submit.js 720 B

12345678910111213141516171819202122
  1. $(document).on('submit', '.form-prevent-multiple-submits', function (event) {
  2. click_submit_btn(this)
  3. })
  4. $(document).on('click', '.spinner-btn', function () {
  5. $('#pace-progress-panel').attr('hidden', false)
  6. })
  7. $(document).on('click', '.modal-spinner-btn', function () {
  8. $('#pace-progress-modal-panel').attr('hidden', false)
  9. })
  10. function click_submit_btn($this, disabled = true) {
  11. if (disabled) {
  12. $($this).find('.button-prevent-multiple-submits').attr('disabled', true)
  13. $($this).find('.spinner').css('display', 'inline-block')
  14. } else {
  15. $($this).find('.button-prevent-multiple-submits').attr('disabled', false)
  16. $($this).find('.spinner').css('display', 'none')
  17. }
  18. }