diff --git a/basicswap/static/js/offerstable.js b/basicswap/static/js/offerstable.js index d024ce5..1b0c262 100644 --- a/basicswap/static/js/offerstable.js +++ b/basicswap/static/js/offerstable.js @@ -796,8 +796,9 @@ function updateProfitLoss(row, fromCoin, toCoin, fromAmount, toAmount, isOwnOffe function createTableRow(offer, isSentOffers) { const row = document.createElement('tr'); + const uniqueId = `${offer.offer_id}_${offer.created_at}`; row.className = `opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600`; - row.setAttribute('data-offer-id', `${offer.offer_id}_${offer.created_at}`); + row.setAttribute('data-offer-id', uniqueId); const coinFromSymbol = coinNameToSymbol[offer.coin_from] || offer.coin_from.toLowerCase(); const coinToSymbol = coinNameToSymbol[offer.coin_to] || offer.coin_to.toLowerCase(); @@ -829,6 +830,8 @@ function createTableRow(offer, isSentOffers) { ${createTooltips(offer, isOwnOffer, coinFromDisplay, coinToDisplay, fromAmount, toAmount, postedTime, expiresIn, isActuallyExpired)} `; + updateTooltipTargets(row, uniqueId); + updateProfitLoss(row, coinFromDisplay, coinToDisplay, fromAmount, toAmount, isOwnOffer); return row; @@ -1286,8 +1289,10 @@ function createTooltips(offer, treatAsSentOffer, coinFrom, coinTo, fromAmount, t const percentageTooltipContent = createTooltipContent(treatAsSentOffer, coinFrom, coinTo, fromAmount, toAmount); + const uniqueId = `${offer.offer_id}_${offer.created_at}`; + return ` -