target
: Element
The element that will be dragged.
|
opt_handle
: Element=
An optional handle to control the drag, if null
the target is used.
|
opt_limits
: goog.math.Rect=
Object containing left, top, width,
and height.
|
Calculates the drag position.
Returns: !goog.math.Coordinate
The newly calculated drag element position.
|
code » | |||||
![]()
Unregisters the event handlers that are only active during dragging, and
releases mouse capture.
|
code » | |||||
![]()
Overridable function for computing the initial position of the target
before dragging begins.
|
code » | |||||
![]()
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.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
Arguments:
|
code » | |||||
![]()
Turns on/off true RTL behavior. This should be called immediately after
construction. This is a temporary flag to allow clients to transition
to the new component at their convenience. At some point true will be the
default.
Arguments:
|
code » | |||||
![]()
Event handler that is used to end the drag.
Arguments:
|
code » | |||||
![]()
Event handler that is used to end the drag by cancelling it.
Arguments:
|
code » | |||||
Fires a goog.fx.Dragger.EventType.START event.
Arguments:
Returns: boolean
False iff preventDefault was called on the DragEvent.
|
code » | |||||
No description.
Returns: boolean
Whether the dragger is enabled.
|
code » | |||||
Returns the event handler, intended for subclass use.
Returns: goog.events.EventHandler.<T>
The event handler.
|
code » | |||||
Gets the distance the user has to drag the element before a drag operation is
started.
Returns: number
distance The number of pixels after which a mousedown and
move is considered a drag.
|
code » | |||||
![]()
Event handler that is used on mouse / touch move to update the drag
Arguments:
|
code » | |||||
No description.
Returns: boolean
Whether the dragger is currently in the midst of a drag.
|
code » | |||||
Whether the DOM element being manipulated is rendered right-to-left.
Returns: boolean
True if the DOM element is rendered right-to-left, false
otherwise.
|
code » | |||||
Returns the 'real' x after limits are applied (allows for some
limits to be undefined).
|
code » | |||||
Returns the 'real' y after limits are applied (allows for some
limits to be undefined).
|
code » | |||||
![]()
Re-initializes the event with the first target touch event or, in the case
of a stop event, the last changed touch.
Arguments:
|
code » | |||||
![]()
Event handler for scroll target scrolling.
Arguments:
|
code » | |||||
![]()
Enables cancelling of built-in IE drag events.
Arguments:
|
code » | |||||
![]()
Set whether dragger is enabled
Arguments:
|
code » | |||||
![]()
Sets the distance the user has to drag the element before a drag operation is
started.
Arguments:
|
code » | |||||
![]()
Sets (or reset) the Drag limits after a Dragger is created.
Arguments:
|
code » | |||||
![]()
Sets the SCROLL event target to make drag element follow scrolling.
Arguments:
|
code » | |||||
![]()
Sets up event handlers when dragging starts.
|
code » | |||||
![]()
Event handler that is used to start the drag
Arguments:
|
code » |
![]()
Use
#listen instead, when possible. Otherwise, use
goog.events.listen if you are passing Object
(instead of Function) as handler.
Adds an event listener to the event target. The same handler can only be
added once per the type. Even if you add the same handler multiple times
using the same type then it will only be called once when the event is
dispatched.
Arguments:
|
code » | |||||
![]()
Asserts that the event target instance is initialized properly.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Removes 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.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget
The parent EventTarget or null if
there is no parent.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Use
#unlisten instead, when possible. Otherwise, use
goog.events.unlisten if you are passing Object
(instead of Function) as handler.
Removes an event listener from the event target. The handler must be the
same object as the one added. If the handler has not been added then
nothing is done.
Arguments:
|
code » | |||||
![]()
Sets the parent of this event target to use for capture/bubble
mechanism.
Arguments:
|
code » | |||||
![]()
Sets the target to be used for
event.target when firing
event. Mainly used for testing. For example, see
goog.testing.events.mixinListenable .
Arguments:
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
Current x position of mouse or touch relative to viewport.
|
Code » | |
![]()
Current y position of mouse or touch relative to viewport.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
Current x position of drag relative to target's parent.
|
Code » | |
![]()
Current y position of drag relative to target's parent.
|
Code » | |
![]()
Reference to a document object to use for the events.
|
Code » | |
![]()
Whether object is currently being dragged.
|
Code » | |
![]()
Whether dragging is currently enabled.
|
Code » | |
No description.
|
Code » | |
![]()
Reference to the handler that initiates the drag.
|
Code » | |
![]()
The amount of distance, in pixels, after which a mousedown or touchstart is
considered a drag.
|
Code » | |
![]()
Whether IE drag events cancelling is on.
|
Code » | |
Object representing the limits of the drag region.
|
Code » | |
![]()
Timestamp of when the mousedown or touchstart occurred.
|
Code » | |
The current page scroll value.
|
Code » | |
![]()
Whether the element is rendered right-to-left. We initialize this lazily.
|
Code » | |
![]()
Current x position of mouse or touch relative to screen. Deprecated because
it doesn't take into affect zoom level or pixel density.
|
Code » | |
![]()
Current y position of mouse or touch relative to screen. Deprecated because
it doesn't take into affect zoom level or pixel density.
|
Code » | |
![]()
The SCROLL event target used to make drag element follow scrolling.
|
Code » | |
![]()
The x position where the first mousedown or touchstart occurred.
|
Code » | |
![]()
The y position where the first mousedown or touchstart occurred.
|
Code » | |
![]()
Reference to drag target element.
|
Code » | |
![]()
Whether the dragger implements the changes described in http://b/6324964,
making it truly RTL. This is a temporary flag to allow clients to transition
to the new behavior at their convenience. At some point it will be the
default.
|
Code » |
The object to use for event.target. Useful when mixing in an
EventTarget to another object.
|
Code » | |
![]()
No description.
|
Code » | |
Maps of event type to an array of listeners.
|
Code » | |
Parent event target, used during event bubbling.
TODO(user): Change this to goog.events.Listenable. This
currently breaks people who expect getParentEventTarget to return
goog.events.EventTarget.
|
Code » |
Creates copy of node being dragged. This is a utility function to be used
wherever it is inappropriate for the original source to follow the mouse
cursor itself.
|
code » |
![]()
Whether setCapture is supported by the browser.
|
Code » | |
![]()
No description.
|
Code » |
![]()
Constants for event names.
Constants:
|
Code » |