fixed tooltip init for card modal
This commit is contained in:
@@ -49,6 +49,13 @@ import BackToTop from "./BackToTop.astro"
|
|||||||
<script is:inline>
|
<script is:inline>
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
|
// ── Tooltip initializer ───────────────────────────────────────────────────
|
||||||
|
function initTooltips(root = document) {
|
||||||
|
root.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => {
|
||||||
|
bootstrap.Tooltip.getOrCreateInstance(el, { container: 'body' });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// ── Price mode helpers ────────────────────────────────────────────────────
|
// ── Price mode helpers ────────────────────────────────────────────────────
|
||||||
// marketPriceByCondition is injected into the modal HTML via a data attribute
|
// marketPriceByCondition is injected into the modal HTML via a data attribute
|
||||||
// on #inventoryEntryList: data-market-prices='{"Near Mint":6.00,...}'
|
// on #inventoryEntryList: data-market-prices='{"Near Mint":6.00,...}'
|
||||||
@@ -425,6 +432,7 @@ import BackToTop from "./BackToTop.astro"
|
|||||||
|
|
||||||
if (typeof htmx !== 'undefined') htmx.process(modal);
|
if (typeof htmx !== 'undefined') htmx.process(modal);
|
||||||
initInventoryForms(modal);
|
initInventoryForms(modal);
|
||||||
|
initTooltips(modal);
|
||||||
updateNavButtons(modal);
|
updateNavButtons(modal);
|
||||||
initChartAfterSwap(modal);
|
initChartAfterSwap(modal);
|
||||||
switchToRequestedTab();
|
switchToRequestedTab();
|
||||||
@@ -520,6 +528,7 @@ import BackToTop from "./BackToTop.astro"
|
|||||||
|
|
||||||
if (typeof htmx !== 'undefined') htmx.process(target);
|
if (typeof htmx !== 'undefined') htmx.process(target);
|
||||||
initInventoryForms(target);
|
initInventoryForms(target);
|
||||||
|
initTooltips(target);
|
||||||
|
|
||||||
const destImg = target.querySelector('img.card-image');
|
const destImg = target.querySelector('img.card-image');
|
||||||
if (destImg) {
|
if (destImg) {
|
||||||
@@ -649,6 +658,7 @@ import BackToTop from "./BackToTop.astro"
|
|||||||
updateNavButtons(cardModal);
|
updateNavButtons(cardModal);
|
||||||
initChartAfterSwap(cardModal);
|
initChartAfterSwap(cardModal);
|
||||||
initInventoryForms(cardModal);
|
initInventoryForms(cardModal);
|
||||||
|
initTooltips(cardModal);
|
||||||
switchToRequestedTab();
|
switchToRequestedTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -659,6 +669,7 @@ import BackToTop from "./BackToTop.astro"
|
|||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
initInventoryForms();
|
initInventoryForms();
|
||||||
|
initTooltips();
|
||||||
|
|
||||||
const pending = sessionStorage.getItem('pendingSearch');
|
const pending = sessionStorage.getItem('pendingSearch');
|
||||||
if (pending) {
|
if (pending) {
|
||||||
|
|||||||
Reference in New Issue
Block a user