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

showConfirmButton is not working with me #71

Closed
greatsami opened this issue Feb 10, 2020 · 2 comments
Closed

showConfirmButton is not working with me #71

greatsami opened this issue Feb 10, 2020 · 2 comments

Comments

@greatsami
Copy link

  • Package Version: ^3.1
  • Laravel Version: ^6.2

I'm trying to hide OK button by adding ->persistent(false, false) & ->showConfirmButton(false)
But it doesn't work.

What I should do to hide (OK button) when I don't need it?

@realrashid
Copy link
Owner

Hey @greatsami ,
If you want to hide the Confirm Button just use the ->persistent(false,false)

// example:
alert()->success('SuccessAlert','Lorem ipsum dolor sit amet.')->persistent(false,false);

The above example will hide the Confirm Button and Cancel Button too.

@greatsami
Copy link
Author

Hi @realrashid

I did it but it doesn't work.

Actually, I updated /vendor/realrashid/sweet-alert/src/Toaster.php

public function showConfirmButton($btnText = 'Ok', $btnColor = '#3085d6')
    {
        $this->config['showConfirmButton'] = $btnText != '' || $btnText != false ? true : false;
        $this->config['confirmButtonText'] = $btnText;
        $this->config['confirmButtonColor'] = $btnColor;
        $this->config['allowOutsideClick'] = $btnText != '' || $btnText != false ? true : false;
        // $this->removeTimer();

        $this->flash();
        return $this;
    }

Then I used like this:

alert()->success('Created successfully')->showConfirmButton(false)->timerProgressBar();

And it is worked with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants