Home

# Class goog.fx.DragScrollSupport

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.

extends goog.Disposable

Instance Method Summary
| `calculateScrollDelta(number coordinate, number min, number rangeLength) ⇒ number` Calculates scroll delta.
| `constrainBounds_(?goog.math.Rect bounds) ⇒ ?goog.math.Rect` Constrains the container bounds with respect to the margin.

`disposeInternal()`

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.
    ...
    };

| `isInContainerBounds_(number x, number y) ⇒ boolean` Gets whether the input coordinate is in the container bounds.
| `onMouseMove(?goog.events.Event event)` Handler for mouse moves events.
| `onTick_(?goog.events.Event event)` Handler for timer tick event, scrolls the container by one scroll step if needed.
| `setConstrainScroll(boolean 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.
| `setHorizontalScrolling(boolean scrolling)` Sets whether horizontal scrolling is allowed.
| `setupListeners_(boolean externalMouseMoveTracking)` Attaches listeners and activates automatic scrolling.