dojox/layout/DragPane.js

  • Provides:

    • dojox.layout.DragPane
  • Requires:

    • dijit._Widget in common in project dijit
  • dojox.layout.DragPane

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
    • summary
      Makes a pane's content dragable by/within it's surface
    • description
      A small widget which takes a node with overflow:auto and
      allows dragging to position the content. Useful with images,
      or for just adding "something" to a overflow-able div.
  • dojox.layout.DragPane.invert

    • type
      Boolean
    • summary
      Naturally, the behavior is to invert the axis of the drag.
      Setting invert:false will make the pane drag in the same
      direction as the mouse.
  • dojox.layout.DragPane.postCreate

    • type
      Function
    • source: [view]
        this.connect(this.domNode, "onmousedown", "_down");
        this.connect(this.domNode, "onmouseleave", "_up");
        this.connect(this.domNode, "onmouseup", "_up");
    • summary
  • dojox.layout.DragPane._down

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        var t = this.domNode;
        e.preventDefault();
        dojo.style(t, "cursor", "move");
        this._x = e.pageX;
        this._y = e.pageY;
        if ((this._x < t.offsetLeft + t.clientWidth) &&
         (this._y < t.offsetTop + t.clientHeight)) {
         dojo.setSelectable(t,false);
         this._mover = this.connect(t, "onmousemove", "_move");
        }
    • summary
      mousedown handler, start the dragging
  • dojox.layout.DragPane._up

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        dojo.setSelectable(this.domNode,true);
        dojo.style(this.domNode, "cursor", "pointer");
        this._mover && this.disconnect(this._mover);
        delete this._mover;
    • summary
      mouseup handler, stop the dragging
  • dojox.layout.DragPane._move

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        var mod = this.invert ? 1 : -1;
        this.domNode.scrollTop += (this._y - e.pageY) * mod;
        this.domNode.scrollLeft += (this._x - e.pageX) * mod;
        this._x = e.pageX;
        this._y = e.pageY;
    • summary
      mousemove listener, offset the scroll amount by the delta
      since our last call.
  • dojox.layout.DragPane._x

    • summary
  • dojox.layout.DragPane._y

    • summary
  • dojox.layout.DragPane._mover

    • summary
  • dojox.layout

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary