The goog.fx.DragScrollSupport Class

goog.fx.DragScrollSupport
> goog.Disposable

goog.fx.DragScrollSupport(containerNode, opt_margin, opt_externalMouseMoveTracking)

A scroll support class. Currently this class will automatically scroll a scrollable container node and scroll it by a fixed amount at a timed interval when the mouse is moved above or below the container or in vertical margin areas. Intended for use in drag and drop. This could potentially be made more general and could support horizontal scrolling.

containerNode {Element}
A container that can be scrolled.
opt_margin {number=}
Optional margin to use while scrolling.
opt_externalMouseMoveTracking {boolean=}
Whether mouse move events are tracked externally by the client object which calls the mouse move event handler, useful when events are generated for more than one source element and/or are not real mousemove events.
@see
../demos/dragscrollsupport.html

.MARGIN {number}

The suggested scrolling margin.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.onMouseMove(event)

Handler for mouse moves events.

event {goog.events.Event}
Mouse move event.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.setConstrainScroll(constrain)

Sets whether scrolling should be constrained to happen only when the cursor is inside the container node. NOTE: If a margin is not set, then it does not make sense to contain the scroll, because in that case scroll will never be triggered.

constrain {boolean}
Whether scrolling should be constrained to happen only when the cursor is inside the container node.

.setHorizontalScrolling(scrolling)

Sets whether horizontal scrolling is allowed.

scrolling {boolean}
Whether horizontal scrolling is allowed.