create
create copied to clipboard
How to listen to midgardStorage events?
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,
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.)