DragHandler constructor

DragHandler(
  1. [dynamic target]
)

Construct a handler with an Element or List

Implementation

DragHandler([target]) {

  // store a reference to the autostop up handler so we can add and remove it
  _mouseUp = _autoStopUpHandler;
  _mouseDown = _mouseDownHandler;
  _mouseOver = _mouseOverHandler;
  _mouseOut = _mouseOutHandler;
  _mouseMove = _mouseMoveHandler;

  // add initial element(s)
  // non-null check helps dart2js
  if(target != null) {
    if(target is Element) addTarget(target);
    else if(target is List<Element>) addTargets(target);
  }

  // set autostop on by default
  autoStop = true;
}