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

Fix optionsBeforeSubmit + optionConvertHidden for non type=submit actions. #94

Merged
merged 10 commits into from
Jan 18, 2014

Conversation

nathankot
Copy link
Contributor

This should address #89, and possibly #93

I was running into a problem where ngBeforeSubmit wasn't being called at all.
Dug a bit deeper and found that the submit event wasn't being fired on
form when using form[0].submit(). This seems to confirm it:
http://stackoverflow.com/a/18774921/1740868

Probably what was happening, is that the options worked for those using
<input type=submit> and failed for people using the <div> or <a> submit
buttons.

Also updated the readme to show the correct directive for the beforeSubmit option.

@twilson63
Copy link
Owner

@nathankot Thanks for submitting this pull request! It is really appreciated, but when testing your changes against the example/nodejs app, Example 2 fails, because the trigger function is a jQuery method. I tried to use triggerHandler, but it does not trigger the submit either, the only thing I have had luck with is form[0].submit, are you able to get Example 2 working with the trigger change?

Thanks

Tom

@nathankot
Copy link
Contributor Author

@twilson63 hey Tom!

Ahh I didn't take into account that karma was pulling in jQuery, jqLite supports triggerHandler() but it doesn't fire the default event action so I'm gonna use a combination of triggerHandler and form[0].submit, e.stopPropagation should stop a click on the input:submit button from firing.

@twilson63
Copy link
Owner

Cool! Yeah, I need to remove jquery from karma - :)

Thx

Tom

On Thu, Jan 2, 2014 at 8:04 PM, Nathan Kot [email protected] wrote:

@twilson63 https://github.com/twilson63 hey Tom!

Ahh I didn't take into account that karma was pulling in jQuery, jqLite
supports triggerHandler() http://api.jquery.com/triggerHandler/ but it doesn't
fire the default event actionhttp://docs.angularjs.org/api/angular.elementso I'm gonna use a combination of
triggerHandler and form[0].submit, e.stopPropagation should stop a click
on the input:submit button from firing.


Reply to this email directly or view it on GitHubhttps://github.com//pull/94#issuecomment-31498787
.

Tom Wilson
Jack Russell Software Company Division of CareKinesis
494 Wando Park Blvd
Mount Pleasant, SC 29464
Phone: 843-881-2171
Email: [email protected]
Web: http://www.jackhq.com
Calendar:
http://www.google.com/calendar/embed?src=tom%40jackrussellsoftware.com&ctz=America/New_Yorkhttp://www.jackhq.com/calendar

This e-mail may contain information that is confidential, privileged or
otherwise protected from disclosure by the Health Insurance Portability and
Accountability Act (HIPAA) and other state and federal laws. This
information is intended only for the individual names above. Any review,
use disclosure or dissemination of this material is strictly prohibited.
If you receive this information in error, please notify CareKinesis
immediately at 888-974-2763 and delete the original at once.

@twilson63 twilson63 merged commit 0f53ef9 into twilson63:master Jan 18, 2014
@twilson63
Copy link
Owner

@nathankot

Merged and released 5.6, please review if you have time.

@nathankot
Copy link
Contributor Author

@twilson63 thanks for the pull! Will take a look as soon as I can 😄

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

Successfully merging this pull request may close these issues.

2 participants