Documentation

Options

You can customize the bahavior of Clarity by passing in options to the constructor

    
        var library = new DocumentLibrary({
            $anchor: $('#full-width-container'),
            listType:'list'
        });

    

The full list of options for Document List

Option Description Default Valid values
$anchor The DOM element that will hold the Document List. This should be a jquery object null A valid jQuery object that represents a DOM element that is currently on the page
listType Determines the format of the document list list 'list'
'tiles'
'previews'
previewTilesNumColumns If you set the listType to 'previews' this parameter determines the number of columns to display 4 Any valid integer greater than 0
$openItemAnchor If you would like the list and the open document to display in different DOM elements, you need to set this parameter. This is useful for layouts that contain a sidebar. null A valid jQuery object that represents a DOM element that is currently on the page
openInModal Determines whether load the document in a modal window false Boolean (true/false)
openItemWidth Set the width of the document when it's opened a numerical value or a function that returns a number
pluginPath The path to the plugin files relative to the current document.
documentViewerOptions Document Library is built on top of the document viewer plugin. This allows you to set the options for the underlying document viewr plugin. See the table below for the list of values that can be set in this parameter

Document Viewer properties that can be set in the documentViewerOptions property

Option Description Default Valid values
autoPlay Determines if audio/video files start playing immediately after they are loaded true Boolean (true/false)
autoLoadDependencies Determines if the plugin should auto load the 3rd party plugins (pdf.js, jPlayer, flowplayer, prettify). If this is set to false, the dependencies have to be manually added to the page. true Boolean (true/false)
enableTextAndCode Determines if the plugin should load text and code file types (deprecated) false Boolean (true/false)
jPlayer This allows you to override any of the default jPlayer options. {} jPlayer options
timeoutValue Determines how much time to spend trying to load a document (milliseconds) 4000 Integer
setUnsupportedSizeAsSquare