minimap/utils
Functions
cloneEditingViewDomRoot( editor, [ rootName ] ) → HTMLElementinternalmodule:minimap/utils~cloneEditingViewDomRootClones the editing view DOM root by using a dedicated pair of
ViewRendererandViewDomConverter. The DOM root clone updates incrementally to stay in sync with the source root.Parameters
editor : EditorThe editor instance the original editing root belongs to.
[ rootName ] : stringThe name of the root to clone.
Returns
HTMLElementThe editing root DOM clone element.
getClientHeight( domElement ) → numberinternalmodule:minimap/utils~getClientHeightGets client height according to passed DOM element. Returns window's height for
bodyelement.Parameters
domElement : HTMLElement
Returns
number
getDomElementRect( domElement ) → Rectinternalmodule:minimap/utils~getDomElementRectGets dimensions rectangle according to passed DOM element. Returns whole window's size for
bodyelement.Parameters
domElement : HTMLElement
Returns
getPageStyles() → Array<string | object>internalmodule:minimap/utils~getPageStylesHarvests all web page styles, for instance, to allow re-using them in an
<iframe>preserving the look of the content.The returned data format is as follows:
[ 'p { color: red; ... } h2 { font-size: 2em; ... } ...', '.spacing { padding: 1em; ... }; ...', '...', { href: 'http://link.to.external.stylesheet' }, { href: '...' } ]Copy codeNote: For stylesheets with
hrefdifferent than window origin, an object is returned because accessing rules of these styles may cause CORS errors (depending on the configuration of the web page).Returns
Array<string | object>
getScrollable( domElement ) → Window | HTMLElementinternalmodule:minimap/utils~getScrollableReturns the DOM element itself if it's not a
bodyelement, whole window otherwise.Parameters
domElement : HTMLElement
Returns
Window | HTMLElement