Home

Class goog.fx.Dragger

A class that allows mouse or touch-based dragging (moving) of an element

extends goog.events.EventTarget
Instance Method Summary
calculatePosition_(number dx, number dy) ⇒ ?goog.math.Coordinate

Calculates the drag position.

defaultAction(number x, number y)

Overridable function for handling the default action of the drag behaviour. Normally this is simply moving the element to x,y though in some cases it might be used to resize the layer. This is basically a shortcut to implementing a default ondrag event handler.

disposeInternal()

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

MyClass.prototype.disposeInternal = function() {
MyClass.superClass_.disposeInternal.call(this);
// Dispose logic for MyClass
};

doDrag(?goog.events.BrowserEvent e, number x, number y, boolean dragFromScroll)
endDrag(?goog.events.BrowserEvent e, boolean= opt_dragCanceled)

Event handler that is used to end the drag

endDragCancel(?goog.events.BrowserEvent e)

Event handler that is used to end the drag by cancelling it.

getEnabled() ⇒ boolean
getHandler() ⇒ ?goog.events.EventHandler

Returns the event handler, intended for subclass use.

getHysteresis() ⇒ number

Gets the distance the user has to drag the element before a drag operation is started.

handleMove_(?goog.events.BrowserEvent e)

Event handler that is used on mouse / touch move to update the drag

initializeDrag_((goog.events.BrowserEvent|goog.events.Event|null) e)

Event handler that is used to start the drag

limitX(number x) ⇒ number

Returns the 'real' x after limits are applied (allows for some limits to be undefined).

limitY(number y) ⇒ number

Returns the 'real' y after limits are applied (allows for some limits to be undefined).

maybeReinitTouchEvent_(?goog.events.BrowserEvent e)

Re-initializes the event with the first target touch event or, in the case of a stop event, the last changed touch.

onScroll_(?goog.events.BrowserEvent e)

Event handler for scroll target scrolling.

setCancelIeDragStart(boolean cancelIeDragStart)

Enables cancelling of built-in IE drag events.

setEnabled(boolean enabled)

Set whether dragger is enabled

setHysteresis(number distance)

Sets the distance the user has to drag the element before a drag operation is started.

setLimits(?goog.math.Rect limits)

Sets (or reset) the Drag limits after a Dragger is created.

setScrollTarget(?EventTarget scrollTarget)

Sets the SCROLL event target to make drag element follow scrolling.

setupDragHandlers()

Sets up event handlers when dragging starts.

startDrag(?goog.events.BrowserEvent e)

Event handler that is used to start the drag