Skip to content

Commit

Permalink
Merge pull request #4 from laravelcm/fix-panel
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
mckenziearts authored Jul 12, 2024
2 parents 7e82c59 + 32b77ba commit 38adcc1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
24 changes: 24 additions & 0 deletions config/livewire-slide-over.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@

return [

/*
|--------------------------------------------------------------------------
| Include CSS
|--------------------------------------------------------------------------
|
| The modal uses TailwindCSS, if you don't use TailwindCSS you will need
| to set this parameter to true. This includes the modern-normalize css.
|
*/
'include_css' => false,

/*
|--------------------------------------------------------------------------
| Include JS
|--------------------------------------------------------------------------
|
| Livewire Slide Overs will inject the required Javascript in your blade template.
| If you want to bundle the required Javascript you can set this to false
| and add `require('vendor/laravelcm/livewire-slide-overs/resources/js/modal');`
| to your script bundler like webpack.
|
*/
'include_js' => true,

/*
|--------------------------------------------------------------------------
| Default Slide Over Position
Expand Down
9 changes: 7 additions & 2 deletions src/SlideOverPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,13 @@ public function getListeners(): array

public function render(): View
{
$jsPath = __DIR__.'/../public/slide-over.js';
$cssPath = __DIR__.'/../public/slide-over.css';
if (config('livewire-slide-overs.include_js', true)) {
$jsPath = __DIR__ . '/../public/slide-over.js';
}

if (config('livewire-slide-overs.include_css', true)) {
$cssPath = __DIR__ . '/../public/slide-over.css';
}

return view('livewire-slide-over::slide-over', [
'jsPath' => $jsPath ?? null,
Expand Down

0 comments on commit 38adcc1

Please sign in to comment.