@@ -27,12 +27,10 @@ class="space-y-6"
27
27
<!-- Tree Items -->
28
28
<div class =" space-y-2" id =" menu-items-container" wire:key =" tree-{{ $refreshKey } }" >
29
29
@foreach ($this -> record -> menuItems ()-> with ([' children' , ' linkable' ])-> whereNull (' parent_id' )-> orderBy (' _lft' )-> get () as $item )
30
- <div data-item-id =" {{ $item -> id } }" >
31
- @livewire (' filament-flexible-content-block-pages::menu-tree-item' , [
32
- ' item' => $item ,
33
- ' maxDepth' => $this -> getMaxDepth ()
34
- ], key (" item-{$item -> id }-{$refreshKey }" ) )
35
- </div >
30
+ @livewire (' filament-flexible-content-block-pages::menu-tree-item' , [
31
+ ' item' => $item ,
32
+ ' maxDepth' => $this -> getMaxDepth ()
33
+ ], key (" item-{$item -> id }-{$refreshKey }" ) )
36
34
@endforeach
37
35
</div >
38
36
@endif
@@ -72,11 +70,6 @@ function menuItemsManager(config) {
72
70
this .$wire .on (' menu-items-updated' , () => {
73
71
this .refreshMenuItems ();
74
72
});
75
-
76
- // Listen for reorder completion (no need to refresh, just hide loading)
77
- this .$wire .on (' menu-items-reordered' , () => {
78
- this .loading = false ;
79
- });
80
73
},
81
74
82
75
refreshMenuItems () {
@@ -125,15 +118,7 @@ function menuItemsManager(config) {
125
118
});
126
119
127
120
// Call the Livewire method to save the new order
128
- this .$wire .reorderMenuItems (items).then (() => {
129
- this .loading = false ;
130
- // Don't manually refresh - the server-side refreshTree() will handle it
131
- }).catch ((error ) => {
132
- console .error (' Reorder failed:' , error);
133
- this .loading = false ;
134
- // Only refresh on error to revert changes
135
- this .refreshMenuItems ();
136
- });
121
+ this .$wire .reorderMenuItems (items);
137
122
},
138
123
139
124
extractItemId (element ) {
0 commit comments