Additional API methods for navbar
VizuaaLOG opened this issue · comments
Thomas Erbe commented
Over the next few versions I think it would great to expand the API methods available, allowing certain settings to be changed at run time, rather than needing to recreate the component. The below are ideas for the navbar, any other ideas please just comment!
hideOnScroll(new_state: boolean)
- Combines theenableHideOnScroll
anddisableHideOnScroll
methods. Returns the current value if no parameter is providedsticky(new_state: boolean)
- Combines theenableSticky
anddisableSticky
methods. Returns the current value if no parameter is provided.stickyOffset(new_value: number)
- Sets a new sticky offset for the navbar. Returns the current value if no parameter is providedstickyShadow(new_state: boolean)
- Sets if the shadow should be shown when sticky. Returns the current value if no parameter is provided.hideOnScroll(new_state: boolean)
- Sets if the navbar should hide on scroll. Returns the current value if no parameter is providedhideOnScrollTolerance(new_value: number)
- Sets the tolerance before the navbar will hide when scrolling. Returns the current value if no parameter is providedtrigger(event_name: string)
- This will trigger the provided event on the alert instance. Note: This wouldn't be restricted to documented events, so could be used for handling custom events
Deprecations
enableHideOnScroll()
- Replaced withhideOnScroll(true)
disableHideOnScroll()
- Replaced withhideOnScroll(false)
enableSticky()
- Replaced withsticky(true)
disableSticky()
- Replaced withsticky(false)
New events
stuck
- Called when the navbar sticks itself to the top of the windowunstuck
- Called when the navbar unsticks itselfhide
- Called when the navbar is hidden, only applies if the hide on scroll is setshow
- Called when the navbar is shown, only applies if the hide on scroll is set
The current color
property will be renamed to type
to keep in line with other dismissable components, primarily the alert.