dojox/mobile/app/_event.js

  • Provides:

    • dojox.mobile.app._event
  • dojox.mobile.app.eventMap

    • type
      Object
    • summary
  • dojox.mobile.app.eventMap.onmousedown

    • summary
  • dojox.mobile.app.eventMap.mousedown

    • summary
  • dojox.mobile.app.eventMap.onmouseup

    • summary
  • dojox.mobile.app.eventMap.mouseup

    • summary
  • dojox.mobile.app.eventMap.onmousemove

    • summary
  • dojox.mobile.app.eventMap.mousemove

    • summary
  • dojo._connect

    • type
      Function
    • parameters:
      • obj: (typeof )
      • event: (typeof )
      • context: (typeof )
      • method: (typeof )
      • dontFix: (typeof )
    • source: [view]
       event = dojox.mobile.app.eventMap[event] || event;
       if(event == "flick" || event == "onflick"){
        if(dojo.global["Mojo"]){
         event = Mojo.Event.flick;
        }else{
         return dojox.mobile.app.connectFlick(obj, context, method);
        }
       }


       return dojo._oldConnect(obj, event, context, method, dontFix);
    • summary
  • dojox.mobile.app.connectFlick

    • type
      Function
    • parameters:
      • target: (typeof Node)
        The DOM node to connect to
      • context: (typeof )
      • method: (typeof )
    • source: [view]
        var startX;
        var startY;
        var isFlick = false;


        var currentX;
        var currentY;


        var connMove;
        var connUp;


        var direction;


        var time;


        // Listen to to the mousedown/touchstart event
        var connDown = dojo.connect("onmousedown", target, function(event){
         isFlick = false;
         startX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
         startY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;


         time = (new Date()).getTime();


         connMove = dojo.connect(target, "onmousemove", onMove);
         connUp = dojo.connect(target, "onmouseup", onUp);
        });


        // The function that handles the mousemove/touchmove event
        var onMove = function(event){
         dojo.stopEvent(event);


         currentX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
         currentY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
         if(Math.abs(Math.abs(currentX) - Math.abs(startX)) > 15){
          isFlick = true;


          direction = (currentX > startX) ? "ltr" : "rtl";
         }else if(Math.abs(Math.abs(currentY) - Math.abs(startY)) > 15){
          isFlick = true;


          direction = (currentY > startY) ? "ttb" : "btt";
         }
        };


        var onUp = function(event){
         dojo.stopEvent(event);


         connMove && dojo.disconnect(connMove);
         connUp && dojo.disconnect(connUp);


         if(isFlick){
          var flickEvt = {
           target: target,
           direction: direction,
           duration: (new Date()).getTime() - time
          };
          if(context && method){
           context[method](flickEvt);
          }else{
           method(flickEvt);
          }
         }
        };
    • summary
      Listens for a flick event on a DOM node.  If the mouse/touch
      moves more than 15 pixels in any given direction it is a flick.
      The synthetic event fired specifies the direction as
      <ul>
      <li><b>'ltr'</b> Left To Right</li>
      <li><b>'rtl'</b> Right To Left</li>
      <li><b>'ttb'</b> Top To Bottom</li>
      <li><b>'btt'</b> Bottom To Top</li>
      </ul>
  • dojox.mobile.app.isIPhone

    • summary
  • dojox.mobile.app.isWebOS

    • summary
  • dojox.mobile.app.isAndroid

    • summary
  • dojo._oldConnect

    • summary
  • dojox.mobile.app._event

    • type
      Object
    • summary
  • dojox.mobile.app

    • type
      Object
    • summary
  • dojox.mobile

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary