Skip to content

Commit

Permalink
Merge pull request #8 from lara-zeus/disable-when-no-content
Browse files Browse the repository at this point in the history
hide tooltip container if the content is null
  • Loading branch information
atmonshi authored Jan 19, 2024
2 parents 6046da0 + 604d632 commit cba5b5c
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions resources/views/popover-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
$descriptionAbove = $getDescriptionAbove();
$descriptionBelow = $getDescriptionBelow();
$canWrap = $canWrap();
$getContent = $getContent();
@endphp

<template x-ref="template">
<div class="fi-popover-content">
{{ $getContent() }}
{{ $getContent }}
</div>
</template>

Expand All @@ -29,25 +31,28 @@

<button
class="w-full fi-popover-trigger cursor-pointer flex items-center gap-2"
x-tooltip="{
trigger: '{{ $getTrigger }}',
placement: '{{ $getPlacement }}',
offset: @js($getOffset),
maxWidth: '{{ $getPopOverMaxWidth }}',
@if($getContent !== null)
x-tooltip="{
trigger: '{{ $getTrigger }}',
placement: '{{ $getPlacement }}',
offset: @js($getOffset),
maxWidth: '{{ $getPopOverMaxWidth }}',
content: () => $refs.template.innerHTML,
appendTo: $root,
allowHTML: true,
interactive: true,
theme: $store.theme,
}">
content: () => $refs.template.innerHTML,
appendTo: $root,
allowHTML: true,
interactive: true,
theme: $store.theme,
}"
@endif
>

{{ $getState }}

@if($getIcon)
<x-filament::icon
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
:icon="$getIcon"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
/>
@endif
</button>
Expand Down

0 comments on commit cba5b5c

Please sign in to comment.