ScrollIntoViewManager

How to get ScrollIntoViewManager

ES2015+:

import ScrollIntoViewManager from 'fontoxml-scroll-into-view/scrollIntoViewManager'

ES5:

define([
	'fontoxml-scroll-into-view/scrollIntoViewManager'
], function (
	ScrollIntoViewManager
) {
});

Type: Class

Provides a way to scroll items into view in the editor and previews.

Methods

Name Description
scrollSourceNodeIntoView

Scroll the given node (in a loaded document) into view.


  Arguments
# Name Type Description
1. viewName String

Use either 'content-view' to scroll the editor or 'content-preview' to scroll a preview.

2. sourceNode Node

The node to scroll into view.

3. [options] Object
  Members

Members

Name Type Description
[alignTo] String

Either 'top', 'bottom' or 'center'. If unspecified, scrolls the least amount necessary to bring the nore into the viewport.

forceScroll Boolean

If false, only scrolls if the item is not already in view.


  Default value
false
offsetFromTop Number

If set, offsets the top of the target downward by the given number of pixels.


  Default value
0
[padding] Number

Number of pixels by which to shrink the viewport area.

preferTop Boolean

If true and the node is larger than the viewport, scrolling keeps the top of the node in view rather than the bottom.


  Default value
false
scrollSourceRangeIntoView

Scroll the given range (in a loaded document) into view.


  Arguments
# Name Type Description
1. viewName String

Use either 'content-view' to scroll the editor or 'content-preview' to scroll a preview.

2. sourceRange Range

Indicates the part of the document to scroll into view.

3. [options] Object
  Members

Members

Name Type Description
[alignTo] String

Either 'top', 'bottom' or 'center'. If unspecified, scrolls the least amount necessary to bring the range into the viewport.

forceScroll Boolean

If false, only scrolls if the range is not already in view.


  Default value
false
offsetFromTop Number

If set, offsets the top of the target downward by the given number of pixels.


  Default value
0
[padding] Number

Number of pixels by which to shrink the viewport area. Can be used to keep the target some distance away from the edges.

preferTop Boolean

If true and the range is larger than the viewport, scrolling keeps the top of the range in view rather than the bottom.


  Default value
false
4. [isDeferred] Boolean

For internal use only. Do not specify a value for this argument.