Constructor
new mw.libs.guiders()
#
Methods
_attach(myGuider) → {jQuery|undefined}
#
undefined}
#
Attaches a guider
Parameters:
| Name | Type | Description |
|---|---|---|
myGuider |
Object | guider to attach |
Returns:
jQuery node for guider's element if successful, or undefined for invalid input.
- Type
-
jQuery
|
undefined
_getAttachCss(attachTo, guider, position) → {Object}
#
Returns CSS for attaching a guider to its associated element
Parameters:
| Name | Type | Description |
|---|---|---|
attachTo |
jQuery | element to attach to |
guider |
Object | guider object |
position |
number | position for guider, using clock model (0-12). |
Returns:
CSS properties for the attachment
- Type
- Object
_guiderById(id) → {Object}
#
Returns the guider by ID.
Add check to create and grab guider from inits if it exists there.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | id of guider |
Returns:
guider object
- Type
- Object
_removeAnimations(myGuider)
#
Remove all animation classes
Parameters:
| Name | Type | Description |
|---|---|---|
myGuider |
Object | guider to remove animations from |
_setupAnimations(myGuider, position)
#
Add appropriate animation class relative to guider position
Parameters:
| Name | Type | Description |
|---|---|---|
myGuider |
Object | guider to add animation class to |
position |
number | guider attachment position |
back()
#
Shows the 'back' step
createGuider(passedSettings) → {Object}
#
Creates a guider
Parameters:
| Name | Type | Description |
|---|---|---|
passedSettings |
Object | settings for the guider |
Returns:
guiders singleton
- Type
- Object
doStep(direction)
#
Move the guider directionally to the corresponding step. eg. next, back
Parameters:
| Name | Type | Description |
|---|---|---|
direction |
string | next or back |
getFlippedPosition(position, options) → {number}
#
Flips a position horizontally, vertically, both, or not all. This can be used for various scenarios, such as handling right-to-left languages and flipping a position if the original one would go off screen.
It accepts both string (e.g. "top") and numeric (e.g. 12) positions.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
position |
string | number | position as in guider settings object |
|||||||||
options |
Object | how to flip Properties:
|
Returns:
position with requested flippings in numeric form
- Type
- number
hideAll(omitHidingOverlay, next) → {Object}
#
Hides all guiders
Parameters:
| Name | Type | Description |
|---|---|---|
omitHidingOverlay |
boolean
|
undefined
|
falsy to hide overlay, true not to change it |
next |
boolean | true if caller will immediately show another guider in place of the one being hidden (optional, defaults false) |
Returns:
guiders singleton
- Type
- Object
initGuider(passedSettings)
#
This stores the guider but does no work on it. It is an alternative to createGuider() that defers the actual setup work.
Parameters:
| Name | Type | Description |
|---|---|---|
passedSettings |
Object | Settings |
next()
#
Shows the 'next' step
scrollToCurrent()
#
Scroll to the current guider
show(id) → {undefined|boolean|Object}
#
undefined|boolean|Object}
#
Show a guider
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | id of guider to show. The default is the last guider created. |
Returns:
Undefined in case of error, return value from the guider's onShow, if that is truthy, otherwise the guiders singleton.
- Type
-
undefined| boolean | Object