Skip to content

Commit

Permalink
replaced dropdown component; fixed script issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ctanveer committed Dec 19, 2024
1 parent 1c9b4f1 commit e35326f
Showing 1 changed file with 40 additions and 9 deletions.
49 changes: 40 additions & 9 deletions app/Domain/Widgets/Templates/components/moveableWidget.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,32 @@
@if($name != '' && $noTitle == false)
<h5 class="subtitle pb-m float-left mr-sm">{{ __($name) }}</h5>
@endif
<div class="inlineDropDownContainer float-right">
<a href="javascript:void(0);" class="dropdown-toggle ticketDropDown editHeadline" data-toggle="dropdown">
<i class="fa fa-ellipsis-v" aria-hidden="true"></i>
</a>
<ul class="dropdown-menu">
<li><a href="javascript:void(0)" class="fitContent"><i class="fa-solid fa-up-right-and-down-left-from-center"></i> Resize to fit content</a></li>

<x-global::actions.dropdown content-role="tertiary" position="bottom" align="end"
class="float-right" button-shape="circle"
>
<x-slot:label-text>
<i class='fa fa-ellipsis-v'></i>
</x-slot:label-text>
<x-slot:menu>
<!-- Resize content -->
<x-global::actions.dropdown.item variant="link"
class="fitContent"
>
<i class="fa-solid fa-up-right-and-down-left-from-center"></i> Resize to fit content
</x-global::actions.dropdown.item>

<!-- Hide Widget -->
@if(empty($alwaysVisible))
<li><a href="javascript:void(0)" class="removeWidget"><i class="fa fa-eye-slash"></i> Hide</a></li>
<x-global::actions.dropdown.item variant="link"
class="removeWidget"
>
<i class="fa fa-eye-slash"></i> Hide
</x-global::actions.dropdown.item>
@endif
</ul>
</div>
</x-slot:menu>
</x-global::actions.dropdown>

</div>
<span class="clearall"></span>
<div class="widgetContent {{ ($background == "default") ? 'px-m' : '' }}">
Expand All @@ -28,3 +43,19 @@
<div class="clear"></div>
</div>
</div>

<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.fitContent').on('click', function(e) {
const gridItem = jQuery(this).closest('.grid-stack-item')[0];
leantime.widgetController.resizeWidget(gridItem);
})
jQuery('#removeWidget').on('click', function(e) {
// const gridItem = jQuery(this).closest('.grid-stack-item')[0];
leantime.widgetController.toggleWidgetVisibility();
});
});
</script>

0 comments on commit e35326f

Please sign in to comment.