Skip to content

Commit

Permalink
Don't show warnings if annotation was posted
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Nov 13, 2023
1 parent 69914a1 commit 3e75dbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/views/annotations/edit.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ var $postAsComment = $('#annotation_post_as_comment');
var posted = <%= @posted %>;

$postAsComment.on("change", function () {
// Don't show warnings if the annotation was already posted
if (posted) {
return;
}

if (this.checked) {
const $warningElement = $("#annotation-comment-warning");
const message = constructWarningMessage();
Expand Down Expand Up @@ -248,7 +253,7 @@ previewToggle.addEventListener('change', function () {
// disable post comment checkbox if annotation was already posted
if (posted) {
postComment(true);
postAsComment.disabled = true;
$postAsComment.get(0).disabled = true;
}

initBootstrapPopovers();

0 comments on commit 3e75dbc

Please sign in to comment.