Class: Drawers

Responsiville. Drawers

A drawers element is an element that opens and closes like an an accordion, only it is self contained and has no header/title element like the accordion. Instead it automatically creates an open/close button.

new Responsiville.Drawers(options)

Creates and initialises the drawers.
Name Type Description
options Object The initialisation options of the module.
Properties:
Name Type Description
options Object The options that define the object behaviour.
Properties
Name Type Description
debug boolean Whether to print debug messages in the browser console.
slug boolean A special codename for the instance of the element, to be used as a class on its container and as a key in arrays where it is grouped with other elements of its kind.
exclusive boolean Whether multiple drawers panels drawers can be simultaneously open or not.
container boolean The container element of the drawers panels.
element boolean The selector or element that is the actual panel which opens and closes. It has to be inside the container element.
effect boolean The visual effect to use for opening and closing the elements.
duration boolean The duration of the visual effect when opening and closing the elements.
enter string Comma separated list of breakpoints in which the drawers enters, wihch means it is enabled.
leave string Comma separated list of breakpoints in which the drawers leaves, which means it is disabled.
Author:
  • Nevma, info@nevma.gr
License:
  • Nevma Copyright (c) http://www.nevma.gr
Fires:

Extends

Members

staticResponsiville.Drawers.AUTO_RUN

Properties:
Name Type Description
AUTO_RUN boolean Controls whether this module should run by default, without the developer calling it, using its default settings. Defaults to true.

staticResponsiville.Drawers.defaults

Properties:
Name Type Description
defaults Object Default values for this module settings.

Methods

staticResponsiville.Drawers.autoRun(){void}

Runs through the page and searches for elements that apply to the current module in order to apply it to them automatically. Useful for automatically creating elements with this module's behaviour just by setting up the predefined classes and data attributes in HTML elements of the page.
Returns:
Type Description
void

buttonClick(event)

Handles the drawers button click event. This button toggles the visibility of the panel element.
Name Type Description
event Event The user click event sent by the browser.

closeElement($element)

Closes the given panel element.
Name Type Description
$element jQuery The panel element required to close.
Fires:
Disables the drawers.
Fires:
Returns:
Type Description
void
Enables the drawers.
Fires:
Returns:
Type Description
void

openElement($element)

Opens the given panel element.
Name Type Description
$element jQuery The panel element required to open.
Fires:

setupEvents(){void}

Sets up event handlers necessary for the object to function properly.
Returns:
Type Description
void

Events

Called after closing the element.
Called before closing the element.
Called after the drawers has been disabled.
Called after the drawers has been enabled.
Called after the module has been initialised.
Called after opening the element.
Called before opening the element.