Open aronwoost opened 12 years ago
That sounds like how things work in the ios5-unstable branch. Want to check it?
Ah, ok. Yes, will do.
First let me say thanks for implementing the "componentchange"
changes. Indeed, the components is rendered and measured when "componentchange"
is fired:
function _onComponentChange(evt) {
console.log(evt.m.component.lastPageNumber()); // cool!
}
However, the "monocle:loaded"
behavior remains unchanged compared to the master branch.
I have either this order:
or that:
In the first scenario both components are rendered on "monocle:loaded"
, in the later only one (which makes sense fron the logs, I guess). Also I can confirm, that this is not cache related.
This is quite odd, since the callback that fires loaded
is only invoked when we hear two componentchange
events (see Reader#setBook). I'll set up a test to try to reproduce it.
Let me know if I can provide you with something.
My commit presumptuously closed this. :)
I haven't been able to reproduce it. In my test (test/events/index.html
) in the ios5-unstable branch, monocle:loaded
always fired after all initial monocle:componentchange
events. But I tweaked it so that it would fire even later — after the monocle:turn
event when all iframes have moved to the correct page.
Can you check whether this addresses the problem?
This is somehow related to this ticket.
As I need to hook up with the components content (a.k.a. iFrame.contentDocument) directly, the
'monocle:loaded'
event has special importants to me. I expect the event to tell me "all components displayed and rendered complete".However I noticed that this doesn't work reliable. Sometimes
pageDiv.m.activeFrame.m.component.properties.pageLength
is still undefined when the event is fired.Also another
'monocle:componentchange'
is fired sometimes before and sometimes after'monocle:loaded'
.In my perfect world
'monocle:loaded'
would be fired when both components (in case of using slider) are initialized, measured and rendered. After that I would subscribe to'monocle:componentchange'
and can respond to user interactions.