rydurham / Sentinel

A Sentry bridge package for Laravel
http://www.ryandurham.com/projects/sentinel/
317 stars 68 forks source link

removed else clause from restfulizer #216

Closed pierlon closed 6 years ago

pierlon commented 7 years ago

fixes issue #215

rydurham commented 7 years ago

Will this still work if used on a link without the "action_confirm" class?

pierlon commented 7 years ago

Yes, the attribute onclick() is still added to the element.

rydurham commented 7 years ago

When I try this fix on a link that does not have the "action_confirm" class, the form does not submit.

pierlon commented 7 years ago

I may have misunderstood you. The form submits if I confirm the action or not, so removing the else clause fixes the issue. If the link does not have the "action_confirm" class it should not have the onclick attribute.

rydurham commented 7 years ago

Ideally, the "action_confirm" class would be optional. If not present, the form submission would occur immediately, as intended. If present, the user would be prompted to confirm the action and the form would be submitted (or not) depending on what they choose.