ch.Expandable
Description
Expandable lets you show or hide content. Expandable needs a pair: a title and a container related to title.
How-to
Parameters
-
el
- HTMLElement : A HTMLElement to create an instance of ch.Expandable. -
options
- Object : Options to customize an instance.-
fx
- String : Enable or disable UI effects. You must use: "slideDown", "fadeIn" or "none". Default: "none". -
toggle
- Boolean : Customize toggle behavior. Default: true. -
container
- HTMLElement : The container where the expanbdale puts its content. Default: the next sibling of el parameter. -
content
- String | HTMLElement : The content to be shown into the expandable container.
-
Extends
Mixes In
Properties
.Component#name
String
The name of a component.
.container
HTMLElement
The expandable container.
.Expandable#name
String
The name of the component.
.trigger
HTMLElement
The expandable trigger.
.uid
Number
A unique id to identify the instance of a component.
Methods
-
content
- String | HTMLElement : The content that will be used by expandable. -
options
- Object : A custom options to be used with content loaded by ajax.-
method
- String : The type of request ("POST" or "GET") to load content by ajax. Default: "GET". -
params
- String : Params like query string to be sent to the server. -
cache
- Boolean : Force to cache the request by the browser. Default: true. -
async
- Boolean : Force to sent request asynchronously. Default: true. -
waiting
- String | HTMLElement : Temporary content to use while the ajax request is loading.
-
.constructor()
Returns a reference to the constructor function.
.destroy()
Destroys an instance of Component and remove its data from asociated element.
.disable() → {component}
Disables an instance of Component.
.enable() → {component}
Enables an instance of Component.
.require() → {component}
Adds functionality or abilities from other classes.
.constructor()
Returns a reference to the constructor function.
.destroy()
Destroys an Expandable instance.
.hide() → {expandable}
Hides component's container.
.isShown() → {Boolean}
Returns a Boolean specifying if the component's core behavior is shown. That means it will return 'true' if the component is on, and it will return false otherwise.
.show(content, options) → {expandable}
Shows expandable's content.
Events
'destroy'
Emits when a component is destroyed.
'disable'
Emits when a component is disable.
'enable'
Emits when a component is enabled.
'ready'
Event emitted when the component is ready to use.