EVENT.INIT and EVENT.LOADED not triggering on page refresh
Closed this issue · 4 comments
Issue:
A panel doesn't call the Init function when the page is refreshed. If the panel in question is auto-loaded from the last configuration, the Init function isn't called. It is called, however, when the panel is closed and reopened. Also, the LOADED event seems to do the same thing. Code below:
$scope.panel.on(wcDocker.EVENT.INIT, function() {
console.log("Init");
});
$scope.panel.on(wcDocker.EVENT.LOADED, function() {
console.log("Loaded");
});
Is this not working as expected or is there another event I should be using in this case?
I'll need some more information about this, I've tried using wcDocker.restore()
with a pre-made configuration and I've gotten both the global wcDocker
loaded
event as well as an individual panels init
and loaded
events triggered as they should.
Perhaps this could be related to where you are calling your restore
?
EDIT: Also, I see your use of $scope
, are you using some kind of MVC system? I've seen another have a similar problem before and it was based on the way they were registering their on
handlers, the MVC system was registering them after a callback handler rather than directly inside the onCreate
handler. This caused the events not to trigger since they were being registered after the event was called.
Hmm, now I can't seem to reproduce this. I restarted my server a second time and now it's triggering the INIT and LOADED events.
Close this issue for now and I'll keep an eye on it.
Thanks for looking into it.
I'm glad it's working out!
Also good to hear from you Ryan, haven't seen you in a while! How are things going? What kind of project are you making with wcDocker?