Class Crocodoc.Viewer


Defined in: <ecm\widget\viewer\crocodoc\viewer.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
Crocodoc.Viewer(el, options)
Crocodoc.Viewer constructor

Method Summary

Method Attributes Method Name and Description
 
Destroy the viewer instance
 
Disable links
 
Disable text selection, hiding text layer on pages if it's already there and disabling the loading of new text assets
 
Enable links
 
Enable text selection, loading text assets per page if necessary
 
Focuses the viewport so it can be natively scrolled with the keyboard
<static>  
Crocodoc.Viewer.get(id)
Get a viewer instance by id
<inner>  
init()
 
load()
Intiate loading of document assets
 
scrollBy(left, top)
Scrolls by the given pixel amount from the current location
 
scrollTo(page)
Scroll to the given page
 
setLayout(mode)
Set the layout to the given mode, destroying and cleaning up the current layout if there is one
 
Force layout update
 
zoom(val)
Zoom to the given value

Constructor Detail

Crocodoc.Viewer(el, options)

Crocodoc.Viewer constructor
Parameters:
{jQuery|string|Element} el
The element to wrap
{Object} options
Configuration options

Method Detail

{void} destroy()

Destroy the viewer instance
Returns:
{void}

{void} disableLinks()

Disable links
Returns:
{void}

{void} disableTextSelection()

Disable text selection, hiding text layer on pages if it's already there and disabling the loading of new text assets
Returns:
{void}

{void} enableLinks()

Enable links
Returns:
{void}

{void} enableTextSelection()

Enable text selection, loading text assets per page if necessary
Returns:
{void}

{void} focus()

Focuses the viewport so it can be natively scrolled with the keyboard
Returns:
{void}

<static> {Object} Crocodoc.Viewer.get(id)

Get a viewer instance by id
Parameters:
{number} id
The id
Returns:
{Object} The viewer instance

<inner> init()


{void} load()

Intiate loading of document assets
Returns:
{void}

{void} scrollBy(left, top)

Scrolls by the given pixel amount from the current location
Parameters:
{int} left
Left offset to scroll to
{int} top
Top offset to scroll to
Returns:
{void}

{void} scrollTo(page)

Scroll to the given page
Parameters:
{int|string} page
Page number or one of: Crocodoc.SCROLL_PREVIOUS Crocodoc.SCROLL_NEXT
Returns:
{void}

{void} setLayout(mode)

Set the layout to the given mode, destroying and cleaning up the current layout if there is one
Parameters:
{string} mode
The layout mode
Returns:
{void}

{void} updateLayout()

Force layout update
Returns:
{void}

{void} zoom(val)

Zoom to the given value
Parameters:
{float|string} val
Numeric zoom level to zoom to or one of: Crocodoc.ZOOM_IN Crocodoc.ZOOM_OUT Crocodoc.ZOOM_AUTO Crocodoc.ZOOM_FIT_WIDTH Crocodoc.ZOOM_FIT_HEIGHT
Returns:
{void}