Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow different classes for submitbutton and clearbutton #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/views/components/signature-pad.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
class="{{ $padClasses }}"></canvas>
<div>
<input type="hidden" name="sign" class="sign">
<button type="button" class="sign-pad-button-clear {{$buttonClasses}}">{!! $clearName !!}</button>
<button type="submit" class="sign-pad-button-submit {{$buttonClasses}}">{!! $submitName !!}</button>
<button type="button" class="sign-pad-button-clear {{$clearClasses}}">{!! $clearName !!}</button>
<button type="submit" class="sign-pad-button-submit {{$submitClasses}}">{!! $submitName !!}</button>
</div>
</div>

10 changes: 7 additions & 3 deletions src/Components/SignaturePad.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class SignaturePad extends Component

public string $padClasses;

public string $buttonClasses;
public string $submitClasses;

public string $clearClasses;

public string $borderColor;

Expand All @@ -29,7 +31,8 @@ public function __construct(
float $width = null,
float $height = null,
string $padClasses = '',
string $buttonClasses = '',
string $submitClasses = '',
string $clearClasses = '',
string $borderColor = '#777777',
string $submitName = 'Submit',
string $clearName = 'Clear'
Expand All @@ -38,7 +41,8 @@ public function __construct(
$this->height = $height ?? config('sign-pad.height');

$this->padClasses = $padClasses;
$this->buttonClasses = $buttonClasses;
$this->submitClasses = $submitClasses;
$this->clearClasses = $clearClasses;

$this->borderColor = $borderColor;

Expand Down