Skip to content

Commit 40db243

Browse files
committed
render jquery js on 'panels::body.start'
1 parent 42193d6 commit 40db243

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

resources/dist/filament-tree.js

Lines changed: 1 addition & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/plugin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
const $ = require( "jquery" )( window );
21
require('../js/jquery.nestable')

src/FilamentTreeServiceProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Filament\Support\Assets\Css;
66
use Filament\Support\Assets\Js;
77
use Filament\Support\Facades\FilamentAsset;
8+
use Filament\Support\Facades\FilamentView;
89
use Illuminate\Database\Schema\Blueprint;
910
use SolutionForest\FilamentTree\Macros\BlueprintMarcos;
1011
use Spatie\LaravelPackageTools\Package;
@@ -38,9 +39,13 @@ public function packageBooted(): void
3839
{
3940
FilamentAsset::register([
4041
Css::make('filament-tree-min', __DIR__ . '/../resources/dist/filament-tree.css'),
41-
Js::make('filament-tree-jquery', 'https://code.jquery.com/jquery-3.6.1.slim.min.js'),
4242
Js::make('filament-tree-min', __DIR__ . '/../resources/dist/filament-tree.js'),
4343
], 'solution-forest/filament-tree');
44+
45+
FilamentView::registerRenderHook(
46+
'panels::body.start',
47+
fn (): string => "<script src=\"https://code.jquery.com/jquery-3.6.0.min.js\"></script>",
48+
);
4449
}
4550

4651
protected function registerBlueprintMacros()

0 commit comments

Comments
 (0)