Skip to content

Commit

Permalink
Fix markup choice when there are multiple forms on page #752
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBarnabe committed Jul 31, 2020
1 parent 601007f commit be5f2f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/markup-preview.js
Expand Up @@ -38,7 +38,7 @@ function markupPreview(p) {

function updateContent(previewable) {
var markupOptions = getMarkupOptions(previewable);
var selectedMarkup = document.querySelector('input[name="' + previewable.getAttribute("data-markup-option-name") + '"]:checked').value;
var selectedMarkup = previewable.closest("form").querySelector('input[name="' + previewable.getAttribute("data-markup-option-name") + '"]:checked').value;
var url = previewable.getAttribute("data-preview-source") == "url";

var xhr = new XMLHttpRequest();
Expand Down

0 comments on commit be5f2f9

Please sign in to comment.