Skip to content

Commit

Permalink
Exercise: Disable submit buttons while recorded audio is saving - ref…
Browse files Browse the repository at this point in the history
…s BT#22293
  • Loading branch information
AngelFQC committed Jan 30, 2025
1 parent a83db96 commit b508679
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/main/inc/lib/javascript/record_audio/record_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ window.RecordAudio = (function () {
if (btnSave) {
btnSave.prop('disabled', true).text(btnSave.data('loadingtext'));
}

$('.exercise_save_now_button button, .exercise_actions button').prop('disabled', true);
}
}).done(function (response) {
$(response.message).insertAfter($(rtcInfo.blockId).find('.well'));
Expand All @@ -97,6 +99,8 @@ window.RecordAudio = (function () {
btnStop.prop('disabled', true).addClass('hidden');
btnPause.prop('disabled', true).addClass('hidden');
btnStart.prop('disabled', false).removeClass('hidden');

$('.exercise_save_now_button button, .exercise_actions button').prop('disabled', false);
});
}

Expand Down Expand Up @@ -127,7 +131,7 @@ window.RecordAudio = (function () {
alert(error);
}

if(!!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia)) {
if(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia) {
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
navigator.getUserMedia(mediaConstraints, successCallback, errorCallback);
return;
Expand Down

0 comments on commit b508679

Please sign in to comment.