Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
ejholmes opened this Issue · 2 comments

2 participants

Eric Holmes Christopher Blum
Eric Holmes

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.

Christopher Blum tiff closed this
Christopher Blum tiff reopened this
Christopher Blum
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.

Eric Holmes

Didn't know that. Thanks for the response!

Christopher Blum 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.