Skip to content

Commit

Permalink
Popup: change listing URL hyperlink from mls # to full street address…
Browse files Browse the repository at this point in the history
… heading
  • Loading branch information
perfectly-preserved-pie committed Nov 28, 2024
1 parent d099714 commit ae98279
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions assets/javascript/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@ window.dash_props = Object.assign({}, window.dash_props, {
function getListingUrlBlock(data) {
if (!data.listing_url) {
return `
<tr>
<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;">Listing ID (MLS#)</th>
<td style="padding:8px;border-bottom:1px solid #ddd;">${data.mls_number}</td>
</tr>
<div style="text-align: center;">
<h5>${data.full_street_address}</h5>
</div>
`;
}
return `
<tr>
<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;">Listing ID (MLS#)</th>
<td style="padding:8px;border-bottom:1px solid #ddd;">
<a href='${data.listing_url}' referrerPolicy='noreferrer' target='_blank'>${data.mls_number}</a>
</td>
</tr>
<div style="text-align: center;">
<h5><a href='${data.listing_url}' referrerPolicy='noreferrer' target='_blank'>${data.full_street_address}</a></h5>
</div>
`;
}

Expand Down Expand Up @@ -63,15 +59,16 @@ window.dash_props = Object.assign({}, window.dash_props, {
return `
<div>
${imageRow}
<div style="text-align: center;">
<h5>${data.full_street_address}</h5>
</div>
${listingUrlBlock}
<table style="width:100%;border-collapse:collapse;">
<tr>
<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;">Listed Date</th>
<td style="padding:8px;border-bottom:1px solid #ddd;">${formatDate(data.listed_date)}</td>
</tr>
${listingUrlBlock}
<tr>
<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;">Listing ID (MLS#)</th>
<td style="padding:8px;border-bottom:1px solid #ddd;">${data.mls_number}</td>
</tr>
<tr>
<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;">List Office Phone</th>
<td style="padding:8px;border-bottom:1px solid #ddd;">${phoneNumberBlock}</td>
Expand Down

0 comments on commit ae98279

Please sign in to comment.