dojo/dnd/move.js

  • Provides:

    • dojo.dnd.move
  • dojo.dnd.move.__constrainedMoveableArgs

    • type
      Function
    • chains:
      • dojo.dnd.__MoveableArgs: (prototype)
      • dojo.dnd.__MoveableArgs: (call)
    • summary
  • dojo.dnd.move.__constrainedMoveableArgs.constraints

    • type
      Function
    • source: [view]
      }
    • summary
  • dojo.dnd.move.__constrainedMoveableArgs.within

    • type
      Boolean
    • summary
      restrict move within boundaries.
  • dojo.dnd.move.constrainedMoveable

    • type
      Function
    • chains:
      • dojo.dnd.Moveable: (prototype)
      • dojo.dnd.Moveable: (call)
    • parameters:
      • node: (typeof Node)
        a node (or node's id) to be moved
      • params: (typeof dojo.dnd.move.__constrainedMoveableArgs)
        an optional object with additional parameters;
        the rest is passed to the base class
    • source: [view]
        if(!params){ params = {}; }
        this.constraints = params.constraints;
        this.within = params.within;
    • summary
      an object that makes a node moveable
  • dojo.dnd.move.constrainedMoveable.constraints

    • type
      Function
    • source: [view]
      }
    • summary
  • dojo.dnd.move.constrainedMoveable.within

    • summary
  • dojo.dnd.move.constrainedMoveable.markupFactory

    • type
      Function
    • parameters:
      • params: (typeof )
      • node: (typeof )
    • source: [view]
        return new dojo.dnd.move.constrainedMoveable(node, params);
    • summary
  • dojo.dnd.move.constrainedMoveable.onFirstMove

    • type
      Function
    • parameters:
      • mover: (typeof dojo.dnd.Mover)
    • source: [view]
        var c = this.constraintBox = this.constraints.call(this, mover);
        c.r = c.l + c.w;
        c.b = c.t + c.h;
        if(this.within){
         var mb = dojo._getMarginSize(mover.node);
         c.r -= mb.w;
         c.b -= mb.h;
        }
    • summary
      called during the very first move notification;
      can be used to initialize coordinates, can be overwritten.
    • chains:
      • this.constraints: (call)
  • dojo.dnd.move.constrainedMoveable.onMove

    • type
      Function
    • parameters:
      • mover: (typeof dojo.dnd.Mover)
      • leftTop: (typeof Object)
    • source: [view]
        var c = this.constraintBox, s = mover.node.style;
        this.onMoving(mover, leftTop);
        leftTop.l = leftTop.l < c.l ? c.l : c.r < leftTop.l ? c.r : leftTop.l;
        leftTop.t = leftTop.t < c.t ? c.t : c.b < leftTop.t ? c.b : leftTop.t;
        s.left = leftTop.l + "px";
        s.top = leftTop.t + "px";
        this.onMoved(mover, leftTop);
    • summary
      called during every move notification;
      should actually move the node; can be overwritten.
  • dojo.dnd.move.constrainedMoveable.constraintBox

    • summary
  • dojo.dnd.move.__boxConstrainedMoveableArgs

    • type
      Function
    • chains:
      • dojo.dnd.move.__constrainedMoveableArgs: (prototype)
      • dojo.dnd.move.__constrainedMoveableArgs: (call)
    • summary
  • dojo.dnd.move.__boxConstrainedMoveableArgs.box

    • type
      Object
    • summary
  • dojo.dnd.move.boxConstrainedMoveable

    • type
      Function
    • chains:
      • dojo.dnd.move.constrainedMoveable: (prototype)
      • dojo.dnd.move.constrainedMoveable: (call)
    • parameters:
      • node: (typeof Node)
        a node (or node's id) to be moved
      • params: (typeof dojo.dnd.move.__boxConstrainedMoveableArgs)
        an optional object with parameters
    • source: [view]
        var box = params && params.box;
        this.constraints = function(){ return box; };
    • summary
      an object, which makes a node moveable
  • dojo.dnd.move.boxConstrainedMoveable.box

    • type
      Object
    • summary
  • dojo.dnd.move.boxConstrainedMoveable.markupFactory

    • type
      Function
    • parameters:
      • params: (typeof )
      • node: (typeof )
    • source: [view]
        return new dojo.dnd.move.boxConstrainedMoveable(node, params);
    • summary
  • dojo.dnd.move.boxConstrainedMoveable.constraints

    • type
      Function
    • source: [view]
        this.constraints = function(){ return box;
    • summary
  • dojo.dnd.move.__parentConstrainedMoveableArgs

    • type
      Function
    • chains:
      • dojo.dnd.move.__constrainedMoveableArgs: (prototype)
      • dojo.dnd.move.__constrainedMoveableArgs: (call)
    • summary
  • dojo.dnd.move.__parentConstrainedMoveableArgs.area

    • type
      String
    • summary
      A parent's area to restrict the move.
      Can be &quot;margin&quot;, &quot;border&quot;, &quot;padding&quot;, or &quot;content&quot;.
  • dojo.dnd.move.parentConstrainedMoveable

    • type
      Function
    • chains:
      • dojo.dnd.move.constrainedMoveable: (prototype)
      • dojo.dnd.move.constrainedMoveable: (call)
    • parameters:
      • node: (typeof Node)
        a node (or node's id) to be moved
      • params: (typeof dojo.dnd.move.__parentConstrainedMoveableArgs)
        an optional object with parameters
    • source: [view]
        var area = params && params.area;
        this.constraints = function(){
         var n = this.node.parentNode,
          s = dojo.getComputedStyle(n),
          mb = dojo._getMarginBox(n, s);
         if(area == "margin"){
          return mb; // Object
         }
         var t = dojo._getMarginExtents(n, s);
         mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
         if(area == "border"){
          return mb; // Object
         }
         t = dojo._getBorderExtents(n, s);
         mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
         if(area == "padding"){
          return mb; // Object
         }
         t = dojo._getPadExtents(n, s);
         mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
         return mb; // Object
        };
    • summary
      an object, which makes a node moveable
    • returns
      Object
  • dojo.dnd.move.parentConstrainedMoveable.area

    • type
      object
    • summary
      attributes (for markup)
  • dojo.dnd.move.parentConstrainedMoveable.markupFactory

    • type
      Function
    • parameters:
      • params: (typeof )
      • node: (typeof )
    • source: [view]
        return new dojo.dnd.move.parentConstrainedMoveable(node, params);
    • summary
  • dojo.dnd.move.parentConstrainedMoveable.constraints

    • type
      Function
    • source: [view]
         var n = this.node.parentNode,
          s = dojo.getComputedStyle(n),
          mb = dojo._getMarginBox(n, s);
         if(area == "margin"){
          return mb; // Object
         }
         var t = dojo._getMarginExtents(n, s);
         mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
         if(area == "border"){
          return mb; // Object
         }
         t = dojo._getBorderExtents(n, s);
         mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
         if(area == "padding"){
          return mb; // Object
         }
         t = dojo._getPadExtents(n, s);
         mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
         return mb; // Object
    • returns
      Object
    • summary
  • dojo.dnd.constrainedMover

    • summary
  • dojo.dnd.boxConstrainedMover

    • summary
  • dojo.dnd.parentConstrainedMover

    • summary
  • dojo.dnd.move

    • type
      Object
    • summary
  • dojo.dnd

    • type
      Object
    • summary
  • dojo

    • type
      Object
    • summary