ScrollManager(sectionManager, cm, $previewContainerEl)

Class ScrollManager
manage scroll sync between markdown editor and preview

new ScrollManager(sectionManager, cm, $previewContainerEl)

Creates an instance of ScrollManager.

Parameters:
Name Type Description
sectionManager SectionManager

sectionManager

cm CodeMirror

CodeMirror

$previewContainerEl jQuery

preview container

Members

_currentTimeoutId :number

current timeout id needs animation

_savedScrollInfo :object

Saved scrollInfo object of CodeMirror

Methods

saveScrollInfo()

Save Codemirror's scrollInfo for alternative use
memberOf ScrollManager

syncMarkdownScrollTopToPreview()

syncMarkdownScrollTopToPreview
sync markdown scroll to preview

syncPreviewScrollTopToMarkdown()

syncPreviewScrollTopToMarkdown
sync preview scroll to markdown