Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

How to listen to midgardStorage events? #242

Open
gkzsolt opened this issue Apr 18, 2019 · 1 comment
Open

How to listen to midgardStorage events? #242

gkzsolt opened this issue Apr 18, 2019 · 1 comment

Comments

@gkzsolt
Copy link

gkzsolt commented Apr 18, 2019

Hi,
How can I get an instance of the midgardStorage widget instatiated by Create.js? The doc says how to call some public functions on it, but I don't know how to bind to the events listed.
I would like to bind to the 'midgardstoragesaved' event. How can I do that?
Thanks,

@gkzsolt
Copy link
Author

gkzsolt commented Apr 18, 2019

I found a way to listen to the "save" event, when save is initiated:

jQuery('body').bind('midgardstoragesave', function (ev, data) {
    console.log("storage save event = %o", ev);
});

But unfortunately this does not work for the "saved" event, although this would be the most useful:

jQuery('body').bind('midgardstoragesaved', function (ev, data) {
    console.log("storage was saved, event = %o", ev);
});

It was quite hard to believe for me... What I am doing wrong?
(I am initiating by jQuery('body').midgardCreate( ), although I think you guessed it.)

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

No branches or pull requests

1 participant