dojox/image/Lightbox.LightboxDialog (version 1.10)

Summary

The "dialog" shared between any Lightbox instances on the page, publically available for programmatic manipulation.

A widget that intercepts anchor links (typically around images) and displays a modal Dialog. this is the actual Dialog, which you can create and populate manually, though should use simple Lightbox's unless you need the direct access.

There should only be one of these on a page, so all dojox.image.Lightbox's will us it (the first instance of a Lightbox to be show()'n will create me If i do not exist)

Usage

var foo = new Lightbox.LightboxDialog(args);
dojox/image/Lightbox
Parameter Type Description
args undefined

See the dojox/image/Lightbox.LightboxDialog reference documentation for more information.

Examples

Example 1

// show a single image from a url
var url = "http://dojotoolkit.org/logo.png";
var dialog = new dojox.image.LightboxDialog().startup();
dialog.show({ href: url, title:"My Remote Image"});

Property Summary

  • _groupsan object of arrays, each array (of objects) being a unique 'group'
  • adjustIf true, ensure the image always stays within the viewport more difficult than necessary to disable, but enabled by default seems sane in most use cases.
  • errorImgPath to the image used when a 404 is encountered
  • errorMessageThe text to display when an unreachable image is linked
  • imageClassThe classname to apply to the image node in the dialog (for extra styling)
  • imgUrlThe src="" attribute of our imageNode (can be null at statup)
  • inGroupArray of objects. this is populated by from the JSON object _groups, and should not be populate manually. it is a placeholder for the currently showing group of images in this master dialog
  • modalIf true, this Dialog instance will be truly modal and prevent closing until explicitly told to by calling hide() or clicking the (x) - Defaults to false to preserve previous behaviors. (aka: enable click-to-close on the underlay)
  • templateString
  • titleThe current title, read from object passed to show()

Method Summary

  • _calcTitleSize()
  • _handleKey(e) Handle keyboard navigation internally
  • _loadImage() Do the prep work before we can show another image
  • _makeAnims() make and cleanup animation and animation connections
  • _nextImage() Load next image in group
  • _position(e) we want to know the viewport size any time it changes
  • _prepNodes() A localized hook to accompany _loadImage
  • _prevImage() Load previous image in group
  • _ready(src) A function to trigger all 'real' showing of some src
  • _scaleToFit(size) resize an image to fit within the bounds of the viewport
  • _setImageSize(size) Reset the image size to some actual size.
  • _showImage() Fade in the image, and fire showNav
  • _showNav() Fade in the footer, and setup our connections.
  • _size()
  • addImage(child,group) Add an image to this Master Lightbox
  • hide() Hide the Master Lightbox
  • removeGroup(group) Remove all images in a passed group
  • removeImage(child) Remove an image instance from this LightboxDialog.
  • resizeTo(size,forceTitle) Resize our dialog container, and fire _showImage
  • show(groupData) Show the Master Dialog.
  • startup() Add some extra event handlers, and startup our superclass.

Event Summary

  • _onImageClick(e)
  • onClick(groupData) a stub function, called with the currently displayed image as the only argument

Properties

_groups
Defined by: dojox/image/Lightbox

an object of arrays, each array (of objects) being a unique 'group'

adjust
Defined by: dojox/image/Lightbox

If true, ensure the image always stays within the viewport more difficult than necessary to disable, but enabled by default seems sane in most use cases.

errorImg
Defined by: dojox/image/Lightbox

Path to the image used when a 404 is encountered

errorMessage
Defined by: dojox/image/Lightbox

The text to display when an unreachable image is linked

imageClass
Defined by: dojox/image/Lightbox

The classname to apply to the image node in the dialog (for extra styling)

imgUrl
Defined by: dojox/image/Lightbox

The src="" attribute of our imageNode (can be null at statup)

inGroup
Defined by: dojox/image/Lightbox

Array of objects. this is populated by from the JSON object _groups, and should not be populate manually. it is a placeholder for the currently showing group of images in this master dialog

modal
Defined by: dojox/image/Lightbox

If true, this Dialog instance will be truly modal and prevent closing until explicitly told to by calling hide() or clicking the (x) - Defaults to false to preserve previous behaviors. (aka: enable click-to-close on the underlay)

templateString
Defined by: dojox/image/Lightbox
title
Defined by: dojox/image/Lightbox

The current title, read from object passed to show()

Methods

_calcTitleSize()
Returns:object
_handleKey(e)

Handle keyboard navigation internally

Parameter Type Description
e Event
_loadImage()

Do the prep work before we can show another image

_makeAnims()

make and cleanup animation and animation connections

_nextImage()

Load next image in group

_position(e)

we want to know the viewport size any time it changes

Parameter Type Description
e Event
_prepNodes()

A localized hook to accompany _loadImage

_prevImage()

Load previous image in group

_ready(src)

A function to trigger all 'real' showing of some src

Parameter Type Description
src undefined
_scaleToFit(size)

resize an image to fit within the bounds of the viewport

Parameter Type Description
size Object

The 'size' object passed around for this image

Returns:object
_setImageSize(size)

Reset the image size to some actual size.

Parameter Type Description
size undefined
_showImage()

Fade in the image, and fire showNav

_showNav()

Fade in the footer, and setup our connections.

_size()
addImage(child,group)

Add an image to this Master Lightbox

Parameter Type Description
child Object

The image information to add.

  • href: String - link to image (required)
  • title: String - title to display
group String
Optional

attach to group of similar tag or null for individual image instance

hide()

Hide the Master Lightbox

removeGroup(group)

Remove all images in a passed group

Parameter Type Description
group undefined
removeImage(child)

Remove an image instance from this LightboxDialog.

Parameter Type Description
child Object

A reference to the Lightbox child that was added (or an object literal) only the .href member is compared for uniqueness. The object may contain a .group member as well.

resizeTo(size,forceTitle)

Resize our dialog container, and fire _showImage

Parameter Type Description
size Object
forceTitle undefined
show(groupData)

Show the Master Dialog. Starts the chain of events to show an image in the dialog, including showing the dialog if it is not already visible

Parameter Type Description
groupData Object

needs href and title attributes. the values for this image.

startup()

Add some extra event handlers, and startup our superclass.

Returns:dijit._Widget | function

Perhaps the only dijit._Widget that returns itself to allow 'chaining' or var referencing with .startup()

Events

_onImageClick(e)
Defined by: dojox/image/Lightbox
Parameter Type Description
e undefined

Examples

Example 1

// show a single image from a url
var url = "http://dojotoolkit.org/logo.png";
var dialog = new dojox.image.LightboxDialog().startup();
dialog.show({ href: url, title:"My Remote Image"});
onClick(groupData)
Defined by: dojox/image/Lightbox

a stub function, called with the currently displayed image as the only argument

Parameter Type Description
groupData undefined

Examples

Example 1

// show a single image from a url
var url = "http://dojotoolkit.org/logo.png";
var dialog = new dojox.image.LightboxDialog().startup();
dialog.show({ href: url, title:"My Remote Image"});
Error in the documentation? Can’t find what you are looking for? Let us know!