Forum /
Sencha Touch 1.x Forums /
Sencha Touch 1.x: Discussion /
delay between orientationchange dispatch and capture
delay between orientationchange dispatch and capture
Hi,
I'm looking for dispatching orientationchange and beforeorientationchange right in the time.
But if you try the simple code below:
log = function(name){
console.log(Ext.util.Format.format('"{0}": {1} msec', name, (new Date()).getMilliseconds()));
}
Ext.setup({
onReady: function() {
var panel = new Ext.Panel({
fullscreen: true,
orientationMonitor:true,
listeners:{
beforeorientationchange:function(){ log("beforeorientationchange"); },
orientationchange:function(){ log("orientationchange"); }
}
});
var e = document.createEvent('Events');
e.initEvent('orientationchange', true, false);
e.orientation = "landscape";
document.dispatchEvent(e);
log("dispatch");
}
});
you get a log like this:
"dispatch": 240 msec
"beforeorientationchange": 671 msec
"orientationchange": 672 msec
where the orientation change events are fired pretty much in the same time and both,
about 0.5 seconds after dispatching orientationchange.
Is possible to set that delay without breaking the sencha event machinery?
It seems that sencha defines beforeorientationchange subject to orientationchange ...
it is possible to separate them?
Thanks and regards,
Simone
Sencha - Community Support Team
each "listener" can be configured with a delay attribute.
Thanks for your reply.
I tried also with:
panel.addListener(eventName, handler, scope, {delay:0});
but the result is the same, between the document.dispatchEvent and the handler calls there is always the half second delay (actually a little less ... about 433 ms).
I would like to eliminate that delay because the beforeorientationchange handler would be probably called at the right time, that is before turning the browser view and not after, as it happens.
I thought it was a delay too large to be attributed to the run-time code between dispatch and capture of the event ...
Similar Threads
By stefx in forum Sencha Touch 1.x: Discussion
Replies: 4
Last Post: 30 Sep 2010, 10:23 PM
By miroperez in forum Sencha Touch 1.x: Discussion
Replies: 2
Last Post: 28 Sep 2010, 11:53 AM
By gwthompson in forum Sencha Touch 1.x: Discussion
Replies: 4
Last Post: 6 Jul 2010, 1:07 PM
By diegolovison in forum Ext GWT: Discussion
Replies: 2
Last Post: 1 Apr 2010, 8:12 AM
By nyklogistics in forum Ext GWT: Help & Discussion (1.x)
Replies: 2
Last Post: 20 Oct 2008, 2:13 PM
Tags for this Thread
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us