submit.js 837 B

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