goog.Disposable | |
goog.events.EventTarget | goog.Disposable |
goog.fx.DragListGroup | goog.events.EventTarget |
![]()
Adds a drag list to this DragListGroup.
All calls to this method must happen before the call to init().
Remember that all child nodes (except text nodes) will be made draggable to
any other drag list in this group.
Arguments:
|
code » | |||||
![]()
Adds a single item to the given drag list and sets up the drag listeners for
it.
If opt_index is specified the item is inserted at this index, otherwise the
item is added as the last child of the list.
|
code » | |||||
![]()
Cleans up DOM changes that are made by the
handleDrag* methods.
|
code » | |||||
![]()
Clear all our temporary fields that are only defined while dragging, and
all the bounds info stored on the drag lists and drag elements.
Arguments:
|
code » | |||||
Use goog.fx.Dragger.cloneNode().
Creates copy of node being dragged.
|
code » | |||||
Generates an element to follow the cursor during dragging, given a drag
source element. The default behavior is simply to clone the source element,
but this may be overridden in subclasses. This method is called by
createDragElement() before the drag class is added.
|
code » | |||||
![]()
No description.
|
code » | |||||
Default implementation of the function to get the "handle" element for a
drag item. By default, we use the whole drag item as the handle. Users can
change this by calling setFunctionToGetHandleForDragItem().
|
code » | |||||
Helper for handleDragMove_().
Given the position of the center of the dragger element, figures out whether
it's currently hovering over any of the drag lists.
Arguments:
Returns: Element
If currently hovering over a drag list, returns the drag
list element. Else returns null.
|
code » | |||||
Helper for handleDragMove_().
Given the position of the center of the dragger element, plus the drag list
that it's currently hovering over, figures out the next drag item in the
list that follows the current position of the dragger element. (I.e. if
the drag action ends right now, it would become the item after the current
drag item.)
Arguments:
Returns: Element
Returns the earliest item in the hover list that belongs
after the current position of the dragger element. If all items in the
list should come before the current drag item, then returns null.
|
code » | |||||
No description.
Returns: number
distance The number of pixels after which a mousedown and
move is considered a drag.
|
code » | |||||
Handles the end or the cancellation of a drag action, i.e. END or CLEANUP
event fired by the dragger.
Arguments:
Returns: boolean
Whether the event was handled.
|
code » | |||||
![]()
Handles a MOUSEOUT event fired on the handle element of a drag item.
Arguments:
|
code » | |||||
![]()
Handles a MOUSEOVER event fired on the handle element of a drag item.
Arguments:
|
code » | |||||
![]()
Handles a MOUSEOUT event fired on a drag item.
Arguments:
|
code » | |||||
![]()
Handles a MOUSEOVER event fired on a drag item.
Arguments:
|
code » | |||||
Handles a drag movement (i.e. DRAG event fired by the dragger).
Arguments:
Returns: boolean
The return value for the event.
|
code » | |||||
![]()
Handles the start of a drag action.
Arguments:
|
code » | |||||
![]()
Handles mouse and touch events which may start a drag action.
Arguments:
|
code » | |||||
![]()
Performs the initial setup to make all items in all lists draggable.
|
code » | |||||
![]()
Inserts the current drag item to the appropriate location in the drag list
that we're hovering over (if the current drag item is not already there).
|
code » | |||||
![]()
Inserts the currently dragged item in its new place.
This method is used for insertion only when updateWhileDragging_ is false
(otherwise there is no need for that). In the basic implementation
the element is inserted before the currently hovered over item (this can
be changed by overriding the method in subclasses).
|
code » | |||||
Checks whether a coordinate position resides inside a rectangle.
Arguments:
Returns: boolean
True if 'pos' is within the bounds of 'rect'.
|
code » | |||||
![]()
Listens for drag events on the given drag item. This method is currently used
to initialize drag items.
Arguments:
|
code » | |||||
![]()
Caches the heights of each drag list and drag item, except for the current
drag item.
Arguments:
|
code » | |||||
![]()
Sets a user-supplied CSS class to add to the current drag item (during a
drag action).
If not set, the default behavior adds visibility:hidden to the current drag
item so that it is a block of empty space in the hover drag list (if any).
If this class is set by the user, then the default behavior does not happen
(unless, of course, the class also contains visibility:hidden).
Arguments:
|
code » | |||||
![]()
Sets a user-supplied CSS class to add to a drag item handle on hover (not
during a drag action).
Arguments:
|
code » | |||||
![]()
Sets a user-supplied CSS class to add to a drag item on hover (not during a
drag action).
Arguments:
|
code » | |||||
![]()
Sets a user-supplied CSS class to add to the clone of the current drag item
that's actually being dragged around (during a drag action).
Arguments:
|
code » | |||||
![]()
Sets a user-supplied function used to get the "handle" element for a drag
item. The function must accept exactly one argument. The argument may be
any drag item element.
If not set, the default implementation uses the whole drag item as the
handle.
Arguments:
|
code » | |||||
![]()
Sets the distance the user has to drag the element before a drag operation
is started.
Arguments:
|
code » | |||||
![]()
Sets the property of the currDragItem that it is always displayed in the
list.
|
code » | |||||
![]()
Sets the private property updateWhileDragging_ to false. This disables the
update of the position of the currDragItem while dragging. It will only be
placed to its new location once the drag ends.
|
code » | |||||
![]()
Updates the value of currHoverItem_.
This method is used for insertion only when updateWhileDragging_ is false.
The below implementation is the basic one. This method can be extended by
a subclass to support changes to hovered item (eg: highlighting). Parametr
opt_draggerElCenter can be used for more sophisticated effects.
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 » |
![]()
No description.
|
Code » | |
![]()
The user-supplied CSS classes to add to the current drag item (during a drag
action).
|
Code » | |
![]()
The current drag item being moved.
Note: This is only defined while a drag action is happening.
|
Code » | |
![]()
The current item in the list we are hovering over. We need to remember
this in case we do not update the position of the current drag item while
dragging (see
updateWhileDragging_ ). In this case the current drag
item will be inserted into the list before this element when the drag ends.
|
Code » | |
![]()
The drag list that
this.currDragItem_ is currently hovering over, or
null if it is not hovering over a list.
|
Code » | |
![]()
Which drag item corresponds to a given handle. Set by init().
Specifically, this maps from the unique ID (as given by goog.getUid)
of the handle to the drag item.
|
Code » | |
![]()
The user-supplied CSS classes to add to a drag item handle on hover (not
during a drag action).
|
Code » | |
![]()
The user-supplied CSS classes to add to a drag item on hover (not during a
drag action).
|
Code » | |
![]()
All the drag items. Set by init().
|
Code » | |
![]()
The drag lists.
|
Code » | |
![]()
The user-supplied CSS classes to add to the clone of the current drag item
that's actually being dragged around (during a drag action).
|
Code » | |
![]()
The clone of the current drag item that's actually being dragged around.
Note: This is only defined while a drag action is happening.
|
Code » | |
The dragger object.
Note: This is only defined while a drag action is happening.
|
Code » | |
The event handler for this instance.
|
Code » | |
![]()
The amount of distance, in pixels, after which a mousedown or touchstart is
considered a drag.
|
Code » | |
![]()
Whether the currDragItem is always displayed. By default the list
collapses, the currDragItem's display is set to none, when we do not
hover over a draglist.
|
Code » | |
![]()
Whether the setup has been done to make all items in all lists draggable.
|
Code » | |
![]()
The original drag list that the current drag item came from. We need to
remember this in case the user drops the item outside of any lists, in which
case we return the item to its original location.
Note: This is only defined while a drag action is happening.
|
Code » | |
![]()
The original next item in the original list that the current drag item came
from. We need to remember this in case the user drops the item outside of
any lists, in which case we return the item to its original location.
Note: This is only defined while a drag action is happening.
|
Code » | |
![]()
Whether to update the position of the currDragItem as we drag, i.e.,
insert the currDragItem each time to the position where it would land if
we were to end the drag at that point. Defaults to true.
|
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 » |
Private helper for getHoverNextItem_().
Given the bounds of an item, computes the item's bottom y-value.
Arguments:
Returns: number
The item's bottom y-value.
|
code » | |||
Private helper for getHoverNextItem_().
Given the bounds of an item, computes the item's left x-value.
Arguments:
Returns: number
The item's left x-value.
|
code » | |||
Private helper for getHoverNextItem_().
Given the bounds of an item, computes the item's right x-value.
Arguments:
Returns: number
The item's right x-value.
|
code » | |||
Private helper for getHoverNextItem_().
|
code » | |||
Private helper for getHoverNextItem_().
|
code » | |||
Private helper for getHoverNextItem().
Given an item and a target determine the vertical distance from the item's
center to the target.
Arguments:
Returns: number
The vertical distance between the center of the item and
the target.
|
code » |
![]()
Events dispatched by this class.
|
Code » | |
![]()
No description.
|
Code » |