Skip to content

Commit

Permalink
feat(pat contentbrowser): use title attribute of select button to dis…
Browse files Browse the repository at this point in the history
…play path info of selected object
  • Loading branch information
1letter committed Dec 4, 2024
1 parent de97b87 commit b28f789
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/pat/contentbrowser/src/ContentBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,6 @@
}, 500);
}
function initToolTips(){
// init the tooltips for select buttons in contentbrowser
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
console.log(tooltipTriggerList, tooltipList)
}
$: {
if ($showContentBrowser) {
contentItems.get({ path: $currentPath });
Expand Down Expand Up @@ -416,7 +409,6 @@
<div
class="levelColumn{i % 2 == 0 ? ' odd' : ' even'}"
in:fly|local={{ duration: 300 }}
use:initToolTips
>
<div class="levelToolbar">
{#if i == 0 && $config.mode == "browse"}
Expand All @@ -434,13 +426,10 @@
{#if level.selectable}
<button
class="btn btn-primary btn-xs"
data-bs-toggle="tooltip"
data-bs-title="{level.displayPath}"
data-bs-placement="top"
data-bs-custom-class="contentbrowser-tooltip"
title="{level.displayPath}"
disabled={!isSelectable(level)}
on:click|preventDefault={() => addItem(level)}
>
>
{_t("select ${level_path}", {
level_path: level.Title,
})}
Expand Down Expand Up @@ -765,10 +754,4 @@
text-align: center;
padding: 0.25rem 0;
}
/* override the default tooltip z-index, because contentbrowser is on a higher level */
:global(div.tooltip.contentbrowser-tooltip){
--bs-tooltip-zindex: 2000;
z-index: var(--bs-tooltip-zindex);
}
</style>

0 comments on commit b28f789

Please sign in to comment.