new UiHelper()
Helper functions for user interface
everything directly UI-related, which fits nowhere else
- Source:
Methods
(private, static) historyChange(event)
handle history (pop) state changes
currently this does only handle redirects to the home page.
Parameters:
Name | Type | Description |
---|---|---|
event |
Event |
- Source:
(static) init()
initialize
- Source:
(static) isVisible($element)
checks whether the element is currently visible in the viewport (so
the user can actually see it)
Parameters:
Name | Type | Description |
---|---|---|
$element |
jQuery | The link hash to move to. |
- Source:
- See:
(static) mockHistoryChange(state)
trigger a history (pop) state change
used to test the UiHelper.historyChange private function
Parameters:
Name | Type | Description |
---|---|---|
state |
string | (optional) state to mock |
- Source:
(static) reloadHome()
reload the page
This takes the user to the PrivateBin homepage.
- Source:
(static) scrollTo($element, animationDuration, animationEffect, finishedCallback)
scrolls to a specific element
Parameters:
Name | Type | Description |
---|---|---|
$element |
jQuery | The link hash to move to. |
animationDuration |
number | string | passed to jQuery .animate, when set to 0 the animation is skipped |
animationEffect |
string | passed to jQuery .animate |
finishedCallback |
function | function to call after animation finished |