Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Trigger click on data-wysihtml5-dialog-action="save" #60

Closed
ejholmes opened this Issue · 2 comments

2 participants

@ejholmes

What's the proper way to trigger a save on a dialog via JavaScript? I've tried something like:

$('[data-wysihtml5-dialog-action="save"]').trigger('click');

But it doesn't cause the dialog to save.

@tiff tiff closed this
@tiff tiff reopened this
@tiff
Collaborator

That's not working like that since jQuery can't trigger events that itself didn't attach.

You'll need to write your own triggerEvent function (or you just copy the one from QUnit which should work perfectly in all browsers: https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L634).

There's currently no better way to save and close the dialog. Sorry for that.

@ejholmes

Didn't know that. Thanks for the response!

@tiff tiff closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.