Skip to content

Commit

Permalink
render jquery js on 'panels::body.start'
Browse files Browse the repository at this point in the history
  • Loading branch information
cklei-carly committed Oct 6, 2023
1 parent 42193d6 commit 40db243
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
18 changes: 1 addition & 17 deletions resources/dist/filament-tree.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion resources/js/plugin.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
const $ = require( "jquery" )( window );
require('../js/jquery.nestable')
7 changes: 6 additions & 1 deletion src/FilamentTreeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Filament\Support\Assets\Css;
use Filament\Support\Assets\Js;
use Filament\Support\Facades\FilamentAsset;
use Filament\Support\Facades\FilamentView;
use Illuminate\Database\Schema\Blueprint;
use SolutionForest\FilamentTree\Macros\BlueprintMarcos;
use Spatie\LaravelPackageTools\Package;
Expand Down Expand Up @@ -38,9 +39,13 @@ public function packageBooted(): void
{
FilamentAsset::register([
Css::make('filament-tree-min', __DIR__ . '/../resources/dist/filament-tree.css'),
Js::make('filament-tree-jquery', 'https://code.jquery.com/jquery-3.6.1.slim.min.js'),
Js::make('filament-tree-min', __DIR__ . '/../resources/dist/filament-tree.js'),
], 'solution-forest/filament-tree');

FilamentView::registerRenderHook(
'panels::body.start',
fn (): string => "<script src=\"https://code.jquery.com/jquery-3.6.0.min.js\"></script>",
);
}

protected function registerBlueprintMacros()
Expand Down

0 comments on commit 40db243

Please sign in to comment.