Skip to content

Commit

Permalink
Disable editor's save button while it is saving
Browse files Browse the repository at this point in the history
After pressing the save button, the saving can take a while. During that
time a progress bar appears and the save button should be disabled to
avoid getting many save requests and consequently duplicated revisions
of the file.
  • Loading branch information
saraycp committed Aug 26, 2021
1 parent b28ee9d commit 8fc9aca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/app/assets/javascripts/webui/cm2/use-codemirror.js
Expand Up @@ -81,6 +81,7 @@ function use_codemirror(id, read_only, mode, big_editor) {
var data = textarea.data('data');
data[data['submit']] = editors[id].getValue();
data['comment'] = $("#comment_" + id).val();
$(this).prop('disabled', true);
$("#loading_" + id).attr('disabled', true).removeClass("d-none");
$.ajax({
url: textarea.data('save-url'),
Expand Down

0 comments on commit 8fc9aca

Please sign in to comment.