B2G/gecko/browser/base/content/sanitizeDialog.js
/**
   * Helper function for the dragstart event.  Your dragstart listener should
   * call this.  It starts a drag session.
   *
   * @param aEvent
   *        The observed dragstart event
   */
Helper function for the dragstart event.  Your dragstart listener should
call this.  It starts a drag session.

@param aEvent
The observed dragstart event
Helper function for the dragstart event . Your dragstart listener should call this . It starts a drag session . @param aEvent The observed dragstart event
function CSTH_ondragstart(aEvent)
  {
    var tbo = this.tree.treeBoxObject;
    var clickedRow = tbo.getRowAt(aEvent.clientX, aEvent.clientY);
    if (clickedRow !== this.getGrippyRow())
      return;
    var arr = Cc["@mozilla.org/supports-array;1"].
              createInstance(Ci.nsISupportsArray);
    var trans = Cc["@mozilla.org/widget/transferable;1"].
                createInstance(Ci.nsITransferable);
    trans.init(null);
    trans.setTransferData('dummy-flavor', null, 0);
    arr.AppendElement(trans);
    var reg = Cc["@mozilla.org/gfx/region;1"].
              createInstance(Ci.nsIScriptableRegion);
    reg.setToRect(Infinity, Infinity, 1, 1);
    var ds = Cc["@mozilla.org/widget/dragservice;1"].
             getService(Ci.nsIDragService);
    ds.invokeDragSession(aEvent.target, arr, reg, ds.DRAGDROP_ACTION_MOVE);
  }
function CSTH_ondragstart ( aEvent ) { var tbo = this . tree . treeBoxObject ; var clickedRow = tbo . getRowAt ( aEvent . clientX , aEvent . clientY ) ; if ( clickedRow !== this . getGrippyRow ( ) ) return ; var arr = Cc [ "@mozilla.org/supports-array;1" ] . createInstance ( Ci . nsISupportsArray ) ; var trans = Cc [ "@mozilla.org/widget/transferable;1" ] . createInstance ( Ci . nsITransferable ) ; trans . init ( null ) ; trans . setTransferData ( 'dummy-flavor' , null , 0 ) ; arr . AppendElement ( trans ) ; var reg = Cc [ "@mozilla.org/gfx/region;1" ] . createInstance ( Ci . nsIScriptableRegion ) ; reg . setToRect ( Infinity , Infinity , 1 , 1 ) ; var ds = Cc [ "@mozilla.org/widget/dragservice;1" ] . getService ( Ci . nsIDragService ) ; ds . invokeDragSession ( aEvent . target , arr , reg , ds . DRAGDROP_ACTION_MOVE ) ; }
Helper function for the dragstart event.
Helper function for the dragstart event .
// This part is a hack.  What we really want is a grab and slide, not // drag and drop.  Start a move drag session with dummy data and a // dummy region.  Set the region's coordinates to (Infinity, Infinity) // so it's drawn offscreen and its size to (1, 1).