Open GoogleCodeExporter opened 8 years ago
That's a pretty clean patch -- thanks! Is it a patch against 0.31 or
0.40-dev1? There is some event support in
0.40 that this might be an extension to. If we define an "iuiload' event, we
could just call send
sendEvent("iuiload", body)...
Original comment by msgilli...@gmail.com
on 16 Dec 2009 at 7:09
This patch is against a recent mercurial version. Sending an event at the end
of the load handler would
also be a solution. Maybe that's more consistent with the rest of iui.
Original comment by hendrik@van-antwerpen.net
on 16 Dec 2009 at 11:48
The advantage of this method over an event is that is saves the user
administration on the state of iui.
Now you just call addOnLoad and your sure the function is executed as soon as
possible. Otherwise you
have to implement this yourself, based on the event.
Original comment by hendrik@van-antwerpen.net
on 17 Dec 2009 at 12:40
I don't know how patach acceptance works normally. Is there anything more to be
done,
before this could be included?
Original comment by hendrik@van-antwerpen.net
on 28 Dec 2009 at 1:42
It should be possible to combine the event mechanism with immediately running
the function. The would
result in less code and a structure similar to the other callbacks, but would
also have the advantage you
mention of just calling iui.addOnLoad to guarantee your function is called.
I would also recommend starting a discussion on the iui-developers list about
this patch and alternatives to
see what comments and/or improvements others may have.
A sample and/or a test for the patch would also be great.
I think having a mechanism like this is essential to supporting plugins which
is the focus of release 0.40. I'd
like to get something included soon.
Original comment by msgilli...@gmail.com
on 28 Dec 2009 at 8:56
It would be nice to have a hook that will call a function before iUI is loaded
AND another for after iUI is loaded...
Original comment by msgilli...@gmail.com
on 10 Feb 2010 at 4:09
Hendrik, do you have a use case for when a user will be calling addOnLoad and
will not be sure of the state of
iUI. I can think of two use cases
1) During page loading register a function to be called after content loaded
BUT BEFORE iUI is initialized
2) During page loading register a function to be called after content is
loading AND AFTER iUI is initialized
I'm getting ready to put in some code to address this issue (we used your patch
for iuiPad, btw -- I also noticed
that you were playing with iScroll back in January, I'd be interested in
knowing what you found)
Original comment by msgilli...@gmail.com
on 25 Apr 2010 at 4:17
Hendrik's patch is in an Hg clone:
http://code.google.com/r/hendrikvanantwerpen-iui/source/detail?r=4f52314330055f7
c308f9631c650117a25c79e30
Original comment by msgilli...@gmail.com
on 25 Apr 2010 at 4:29
I think the second use-case is important.
For example: on pageload you start initializing your application, which uses
iUI to
show pages. If you call iUI before it's onload is called, things won't work. To
prevent this, inject a call to addOnLoad somewhere in my initialization
sequence to
make sure that iUI is loaded before you continue.
About iScroll: It looks pretty nice, but iPhone Safari behaves strange when you
start
touch events on form inputs. Basically no events (neither touch events nor
timers)
are fired until you let go. This makes it nearly impossible to implement a
generic
scrolling solution which works well with forms.
Original comment by hendrik@van-antwerpen.net
on 26 Apr 2010 at 8:47
Original issue reported on code.google.com by
hendrik@van-antwerpen.net
on 16 Dec 2009 at 4:26Attachments: