Skip to content

Commit

Permalink
Display footnote index value to simplify the editing experience
Browse files Browse the repository at this point in the history
  • Loading branch information
jsma committed Feb 23, 2022
1 parent 0a13e37 commit d16c0d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wagtail_footnotes/static/footnotes/js/footnotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ class FootnoteSource extends React.Component {
var live_footnotes = document.querySelectorAll(
"#id_footnotes-FORMS > li:not(.deleted)"
);
Array.prototype.forEach.call(live_footnotes, function (value) {
Array.prototype.forEach.call(live_footnotes, function (value, i) {
var text = $(".public-DraftEditor-content", value).text();
var uuid = $('input[id*="-uuid"]', value)[0].value;
const index = i + 1;
var row = $(
"<tr data-uuid=" +
uuid +
"><td>" +
"[" + index + "] " +
text +
"</td><td>" +
uuid.substring(0, 6) +
Expand Down

0 comments on commit d16c0d7

Please sign in to comment.