Skip to content

Commit

Permalink
allow custom id for preview block
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Sep 16, 2021
1 parent 305f626 commit 62eb09b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ckanext/latex/assets/scripts/latex-parse-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ ckan.module("latex-parse-form", function ($) {
return {
options: {
previewPlaceholder: "Preview for the LaTeX input",
previewId: "field-latex-preview",
previewIdentifier: "field-latex-preview",
throwOnError: false,
},
initialize: function () {
this.input = this.el[0]
this.previewEl = document.querySelector(`#${this.options.previewId}`);
this.previewEl = document.querySelector(`#${this.options.previewIdentifier}`);

if (!this.previewEl) {
return;
Expand Down
4 changes: 2 additions & 2 deletions ckanext/latex/templates/scheming/form_snippets/latex.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% endcall %}


<div class="preview">
<span id="field-latex-preview">
<div class="preview form-control">
<span id="{{ field.preview_identifier or 'field-latex-preview' }}">
</span>
</div>

0 comments on commit 62eb09b

Please sign in to comment.