1. #1
    Ext User
    Join Date
    Oct 2010
    Posts
    2
    Vote Rating
    0
    csimon is on a distinguished road

      0  

    Default 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

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    78
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    each "listener" can be configured with a delay attribute.

  3. #3
    Ext User
    Join Date
    Oct 2010
    Posts
    2
    Vote Rating
    0
    csimon is on a distinguished road

      0  

    Default


    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

  1. Maps problem on orientationchange
    By stefx in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 30 Sep 2010, 10:23 PM
  2. orientationChange and hidden docked items
    By miroperez in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 28 Sep 2010, 11:53 AM
  3. orientationchange question
    By gwthompson in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 6 Jul 2010, 1:07 PM
  4. Dispatcher - change "dispatch" to protected
    By diegolovison in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 1 Apr 2010, 8:12 AM
  5. What is the different of Dispatcher.get().dispatch & Dispatcher.forwardEvent()?
    By nyklogistics in forum Ext GWT: Help & Discussion (1.x)
    Replies: 2
    Last Post: 20 Oct 2008, 2:13 PM

Thread Participants: 1

Tags for this Thread