goog.fx.DragScrollSupport
Classgoog.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
}
opt_margin
{number
=}
opt_externalMouseMoveTracking
{boolean
=}
.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
}
opt_scope
{Object
=}
.calculateScrollDelta(coordinate, min, rangeLength)
[protected]Calculates scroll delta.
coordinate
{number
}
min
{number
}
rangeLength
{number
}
number
}
.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.
void
}
.disposeInternal()
[protected]Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:
mypackage.MyClass = function() { goog.base(this); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { goog.base(this, 'disposeInternal'); // Dispose logic specific to MyClass. ... };
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.onMouseMove(event)
Handler for mouse moves events.
event
{goog.events.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
}
.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
}
.setHorizontalScrolling(scrolling)
Sets whether horizontal scrolling is allowed.
scrolling
{boolean
}