Members
(constant) getDimensions
Get the dimensions of an element. Used to layer the waiter
screen on top of say 'element'.
- Source:
(constant) hideRecalculate
Hide the recalculate effect from base shiny for a
specific element.
- Source:
Methods
_autoIncrease(size, millisecond)
Auto increase the progress bar every X milliseconds
Parameters:
Name | Type | Description |
---|---|---|
size |
Number | |
millisecond |
Number |
- Source:
_createContainer()
Start progress for specific element(s)
- Source:
_createContainer()
Create the progress bar container
- Source:
_end()
Close and remove progress bar
- Source:
_getOffset(element)
Get an element position on the page
Thanks to `meouw`: http://stackoverflow.com/a/442474/375966
Parameters:
Name | Type | Description |
---|---|---|
element |
Object |
- Source:
Returns:
Element's position info
_getPercentElement(targetElement)
Get the progress bar element
Parameters:
Name | Type | Description |
---|---|---|
targetElement |
Object |
- Source:
_increasePercent(size)
Increase the size of progress bar
Parameters:
Name | Type | Description |
---|---|---|
size |
Number |
- Source:
_kill()
Remove progress bar without finishing
- Source:
_setPercent(percent)
Set percent for all elements
Parameters:
Name | Type | Description |
---|---|---|
percent |
Number |
- Source:
_setPercentFor(targetElement, percent)
Set percent for specific element
Parameters:
Name | Type | Description |
---|---|---|
targetElement |
Object | |
percent |
Number |
- Source:
_setProgress(targetElement)
Set progress bar for specific element
Parameters:
Name | Type | Description |
---|---|---|
targetElement |
Object |
- Source:
createOverlay(params, el)
Create the waiter overlay to place on top of an element.
Parameters:
Name | Type | Description |
---|---|---|
params |
JSON | Parameters see 'defaultWaiter'. |
el |
HTMLElement | Element to overlay. |
- Source:
getMax(id)
Get the max value from a progress bar.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of the progress bar. |
- Source:
getWidth(id, value)
Get the width the progress bar should be set to.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of the progress bar. |
value |
number | Value sent from the server must be more than the 'min' of the progress bar and less than the 'max'. |
- Source:
handleProgress(msg)
Handles messages from the shiny server to set the progress
of the bar and optionally its text.
Parameters:
Name | Type | Description |
---|---|---|
msg |
JSON | JSON object sent from shiny server. |
- Source:
hide(id, onHidden)
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of element containing the waiter. if 'null' assumes the waiter is full screen. |
onHidden |
function | A callback function to call when the waiter is hidden. Leave on 'null' to not use. |
- Source:
position_to_coords(position)
Convert position of to coordinates.
Parameters:
Name | Type | Description |
---|---|---|
position |
string | Convert position to an array of coordinates. |
- Source:
setWaiterHiddenInput(id)
Callback function to set the waiter input on hidden.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of element to show. |
- Source:
setWaiterShownInput(id)
Callback function to set the waiter input on shown.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of element to show. |
- Source:
show(params)
Show a waiter screen
Parameters:
Name | Type | Description |
---|---|---|
params |
JSON | JSON object of options, see 'defaultWaiter'. |
- Source:
Example
// defaults
show({
id: null,
html: '<div class="container--box"><div class="boxxy"><div class="spinner spinner--1"></div></div></div>',
color: '#333e48',
hideOnRender: false,
hideOnError: false,
hideOnSilentError: false,
image: null,
fadeOut: false,
ns: null,
onShown: setWaiterShownInput,
onHidden: setWaiterHiddenInput
});
showRecalculate(id)
Show the recalculate effect from base shiny.
Only useful if it was previously hidden.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of reactive element. |
- Source:
update(id, html)
Update the content of the waiter.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of element to update the waiter. If 'null' assumes the waiter is full screen. |
html |
string | An html string content to replace the waiter. |
- Source: