Skip to content

Commit

Permalink
Merge pull request openwebwork#1110 from drgrice1/another-feedback-po…
Browse files Browse the repository at this point in the history
…sitioning-fix

Fix repositioniong of the feedback popover when typing in MathQuill inputs.
  • Loading branch information
Alex-Jordan authored Sep 8, 2024
2 parents a9ba458 + f7a3ff3 commit ab2499e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion htdocs/js/MathQuill/mqeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
if (input.classList.contains('partially-correct')) answerQuill.classList.add('partially-correct');

// Find the feedback button for this input if there is one on the page.
const feedbackBtn = document.querySelector(`button[data-answer-label="${answerLabel}"`);
const feedbackBtn = Array.from(document.querySelectorAll(`button[data-answer-labels]`)).find((btn) =>
JSON.parse(btn.dataset.answerLabels).includes(answerLabel)
);

// Default options.
const cfgOptions = {
Expand Down
2 changes: 1 addition & 1 deletion macros/PG.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ sub ENDDOCUMENT {
}
)->to_string
),
answer_label => $answerLabel,
answer_labels => JSON->new->encode($response_obj->{response_order}),
bs_toggle => 'popover',
bs_trigger => 'click',
bs_placement => $showCorrectOnly ? 'right' : 'bottom',
Expand Down

0 comments on commit ab2499e

Please sign in to comment.