Skip to content

Commit

Permalink
Added method stretched for Action
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Jul 21, 2024
1 parent da3f6f4 commit 54962d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/layouts/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<tbody>

@foreach($rows as $source)
<tr>
<tr class="position-relative">
@foreach($columns as $column)
{!! $column->buildTd($source, $loop->parent) !!}
@endforeach
Expand Down
17 changes: 17 additions & 0 deletions src/Screen/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,21 @@ protected function getId(): ?string
{
return $this->get('id');
}

/**
* Adds the 'stretched-link' class to the element, making its parent block clickable.
*
* The `stretched` method appends the 'stretched-link' class to the element's 'class' attribute,
* allowing the entire parent block of the element to become clickable.
*
* Notes: The parent block must have `position: relative`.
*
* @return self
*/
public function stretched(): self
{
$this->attributes['class'] .= ' stretched-link';

return $this;
}
}

0 comments on commit 54962d5

Please sign in to comment.