Skip to content

Commit

Permalink
Add support for modal with XL size and fix $type position
Browse files Browse the repository at this point in the history
  • Loading branch information
yuweiweiouo committed Jun 14, 2024
1 parent b1125e1 commit ac4fe36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions resources/views/layouts/modal.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@push('modals-container')
<div class="modal fade center-scale"
<div class="modal fade center-scale {{$type}}"
id="screen-modal-{{$key}}"
role="dialog"
aria-labelledby="screen-modal-{{$key}}"
Expand All @@ -10,7 +10,7 @@
data-modal-open="{{$open}}"
{{$staticBackdrop ? "data-bs-backdrop=static" : ''}}
>
<div class="modal-dialog modal-fullscreen-md-down {{$size}} {{$type}}"
<div class="modal-dialog modal-fullscreen-md-down {{$size}}"
role="document"
id="screen-modal-type-{{$key}}"
>
Expand Down
7 changes: 4 additions & 3 deletions src/Screen/Layouts/Modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Modal extends Layout
{
use Commander;

public const SIZE_XL = 'modal-xl';
public const SIZE_LG = 'modal-lg';
public const SIZE_SM = 'modal-sm';

Expand Down Expand Up @@ -190,7 +191,7 @@ public function open(bool $status = true): self
*/
public function method(string $method): self
{
$this->variables['method'] = url()->current().'/'.$method;
$this->variables['method'] = url()->current() . '/' . $method;

return $this;
}
Expand All @@ -212,7 +213,7 @@ public function staticBackdrop(bool $status = true): self
*/
public function async(string $method): self
{
if (! Str::startsWith($method, 'async')) {
if (!Str::startsWith($method, 'async')) {
$method = Str::start(Str::ucfirst($method), 'async');
}

Expand All @@ -228,7 +229,7 @@ protected function asyncRoute(): ?string
{
$screen = Dashboard::getCurrentScreen();

if (! $screen) {
if (!$screen) {
return null;
}

Expand Down

0 comments on commit ac4fe36

Please sign in to comment.