slick-lightbox.coffee

Slick Lightbox jQuery plugin http://mreq.github.io/slick-lightbox/

Copyright 2014-2016 mreq https://github.com/mreq

Released under the MIT license

Documentation generated by CoffeeDoc

http://mreq.github.io/slick-lightbox/docs/

Classes

The core class.

Instance Methods

constructor(element, @options)

Binds the plugin.

init(index)

Creates the lightbox, opens it, binds events and calls slick. Accepts index of the element, that triggered it (so that we know, on which slide to start slick).

createModalItems()

Creates individual slides to be used with slick. If options.images array is specified, it uses it's contents, otherwise loops through elements' options.itemSelector.

createModal()

Creates a slick-friendly modal.

initSlick(index)

Runs slick by default, using options.slick if provided. If options.slick is a function, it gets fired instead of us initializing slick. Merges in initialSlide option.

open()

Opens the lightbox.

close()

Closes the lightbox and destroys it, maintaining the original element bindings.

bindEvents()

Binds global events.

slideSlick(direction)

Moves the slick prev or next.

detectIE()

Detects usage of IE8 and lower.

getElementCaption(el, info)

Returns caption for each slide based on the type of options.caption.

getElementSrc(el)

Returns src for each slide image based on the type of options.src.

unbindEvents()

Unbinds global events.

destroy(unbindAnchors)

Destroys the lightbox and unbinds global events. If true is passed as an argument, unbinds the original element as well.

destroyPrevious()

Destroys lightboxes currently in DOM.

getTransitionDuration()

Detects the transition duration to know when to remove stuff from DOM etc.

writeHistory()

Writes an empty state to the history API if supported.

filterOutSlickClones($items)

Removes all slick clones from the set of elements. Only does so, if the target element is a slick slider.

handlePossibleCloneClick($clickedItem, $items)

elementIsSlick()

Functions

Fires the plugin.

Removes everything.