Skip to content

Commit

Permalink
Fix Shareable Sources / Family Dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
shogenapps committed Jan 20, 2025
1 parent b44425b commit 7bead99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/features/family_dropdown/family_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async function doFamilyDropdown() {
// Add 'Me' option if enabled
if (window.familyDropdownOptions.addMeLink) {
const userId = getUserNumId();
const user = await getPerson(userId, { fields: ["Name", "FirstName", "LastNameCurrent"] });
const user = await getPerson(userId, { fields: ["Name", "FirstName", "LastNameCurrent", "Bio"] });
if (user) {
let userName = "Me";
if (user.FirstName) {
Expand All @@ -227,7 +227,7 @@ async function doFamilyDropdown() {
}

async function getDataAndMakeWikilink(id) {
const person = await getPerson(id, { fields: ["Name", "FirstName", "LastNameCurrent"] });
const person = await getPerson(id, { fields: ["Name", "FirstName", "LastNameCurrent", "Bio"] });
if (person) {
let personName = "";
if (person.FirstName) {
Expand Down
16 changes: 7 additions & 9 deletions src/features/shareable_sources/shareable_sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ function getSources(person, active = 0) {

// Add source buttons
refArr.forEach(function (aRef, index) {
let button1 = "<button data-ref=" + index + " class='small paste'>Add to Sources</button>";
let button1 = `<button data-ref=${index} class='small paste'>Add to Sources</button>`;

let button2 = "<button data-ref=" + index + " class='small inline'>Add Inline Citation</button>";
let button2 = `<button data-ref=${index} class='small inline'>Add Inline Citation</button>`;

let button3 = "<button data-ref='" + index + "' class='small copyInline'>Copy Inline Citation</button>";
let button3 = `<button data-ref='${index}' class='small copyInline'>Copy Inline Citation</button>`;

if (enhanced == true) {
button2 = button3;
Expand Down Expand Up @@ -225,7 +225,7 @@ function getSources(person, active = 0) {
let ref = $(this).data("ref");
let thePerson = $(this).closest("div.referenceBox").data("id");

let theTextarea = $(".referenceBox[data-id='" + thePerson + "'] textarea[data-ref=" + ref + "]");
let theTextarea = $(`.referenceBox[data-id="${thePerson}"] textarea[data-ref="${ref}"]`);
let theText = theTextarea.html();

let box;
Expand Down Expand Up @@ -310,11 +310,9 @@ function getSources(person, active = 0) {

// Create biography element
const relativeBiography = $(
"<div id='relativeBiography'><h3 id='relBioh3'>" +
displayName(efProfile)[0] +
"'s Bio</h3><x class='small button'>x</x><textarea id='relativeBioContent'>" +
efBio +
"</textarea></div>"
`<div id='relativeBiography'><h3 id='relBioh3'>${
displayName(efProfile)[0]
}'s Bio</h3><x class='small button'>x</x><textarea id='relativeBioContent'>${efBio}</textarea></div>`
);

relativeBiography.insertBefore($(".referenceBox"));
Expand Down

0 comments on commit 7bead99

Please sign in to comment.