Skip to content

iDetailAid $slide API

As well as the iDetailAid Viewer API, there is also slide specific API that can be called from the JavaScript written directly into the slide using the iDetailAid Code Editor.

The $slide object available in the code editor exposes a public API via $slide.api, for example $slide.api.openOverlay( id )

API Methods

Method name description
render Re draw a content area and parse any template tags within.
openOverlay Open an overlay in the current slide.
closeOverlay Close the currently open overlay.
setSwipe Enable / disable swiping for the current slide. See Viewer API to disable it for the whole presentation.
setArrows Enable / disable arrows for the current slide. See Viewer API to disable it for the whole presentation.

render

$slide.api.render( contentAreaSelector, data )

Re draw a content area and parse any template tags within. As well as having the usual access to session / local storage and slide js scope, (ss, ls, js), you can pass in custom data to be read, accessed via cd. For example the string "Hello {{cd.name}} could be rendered with $slide.api.render('#myContentArea', {name:'Bob'});

Argument Type Description
contentAreaSelector string A selector for the content area, usually #ContentAreaName
data object An optional object of key vale pairs to pass into the

openOverlay

$slide.api.openOverlay( overlayId )

Open an overlay in the current slide

Argument Type Description
overlayId string The GUID of the overlay. This can be found in the DOM against the overlay element under data-overlay-id

closeOverlay

$slide.api.closeOverlay()

Close the currently open overlay

setSwipe

$slide.api.setSwipe( state )

Enable or disable swipes on the current slide only. See Viewer API to disable it for the whole presentation, or another slide.

It accepts one argument; state: An object containing one or more of the following keys: 'left', 'right', 'up', 'down'. Each is a boolean: true to enable, false to disable. The update is a patch, so setting only on direction will modify only that direction.

To disable just the left and right:
$slide.api.setSwipe( {left:false, right:false} )

To disable all:
$slide.api.setSwipe( {left:false, right:false, up:false, down:false} )

To enable just one:
$slide.api.setSwipe( {left:true} )

Argument Type Description
state object An object containing one or more of the following keys: 'left', 'right', 'up', 'down'. Each is a boolean: true to enable, false to disable.

setArrows

$slide.api.setArrows( state )

Enable or disable arrows on the current slide only. See Viewer API to disable it for the whole presentation, or another slide.

It accepts one argument; state: An object containing one or more of the following keys: 'left', 'right', 'up', 'down'. Each is a boolean: true to enable the arrow, false to disable it. The update is a patch, so setting only on direction will modify only that direction.

To disable just the left and right:
$slide.api.setArrows( {left:false, right:false} )

To disable all:
$slide.api.setArrows( {left:false, right:false, up:false, down:false} )

To enable just one:
$slide.api.setArrows( {left:true} )

Argument Type Description
state object An object containing one or more of the following keys: 'left', 'right', 'up', 'down'. Each is a boolean: true to enable the arrow, false to disable it.