Waypoints Add-on - Vaadin Add-on Directory
Wrapper for the JavaScript library Waypoints. Can be used to receive events when scrolling into a Vaadin component
# Waypoints Add-on for Vaadin 7
This is an add-on for Vaadin 7 providing a wrapper for the JavaScript library 'Waypoints'. You can check out the original library on
http://imakewebthings.com/waypoints/
With this add-on you can receive events when you scroll to a Vaadin component.
The source code can be found at
https://github.com/christiandusse/vaadin-waypoints
# Features
- Receive events when element is scrolled into viewport.
- Can set offset (top, middle, bottom, absolute, relative or a JavaScript function) of viewport where event should be fired
- Can enable or disable the extension at runtime
- Event has info about the scroll direction and the source on which the event occurs
- Scrollable contexts can be one on UI, Panel, Window, Table, Tabsheet, Acordion, VerticalSplitPanel or HorizontalSplitPanel
- Use shortcut 'Inview' to receive info when element enters, entered, leaves and left the viewport
- Option to scroll into a Vaadin component (using https://github.com/kswedberg/jquery-smooth-scroll)
# Getting started
See the provided code examples for a quick start.
For a more comprehensive example, see the demo project at https://github.com/christiandusse/vaadin-waypoints
# Online demo
Try the add-on demo at http://env-9019740.jelastic.servint.net/waypoints-demo/ (may take a while to load)
# Known issues:
- May lead to infinite loop when scrolling fast while having set a lot of waypoints
- May not receive events on browser size change
- May receive wrong events when having multiple scrollbars in the hierarchy of the extended component
- May receive wrong events for components inside a table
- No support for cells inside a Vaadin grid
# Roadmap
This component is developed as a hobby with no public roadmap or any guarantees of upcoming releases. That said, the following features are planned for upcoming releases:
- Sticky Elements: http://imakewebthings.com/waypoints/shortcuts/sticky-elements/
- Support for cells inside a Vaadin grid
- Events on scrolling because of browser size change
- Settings options lazily
- Provide more options from original library: 'group', 'continuous' http://imakewebthings.com/waypoints/api/waypoint/
- Performance optimization (f.e. option to only receive the last event when scrolling over multiple waypoints at once)
- Better documentation
- Integration tests
Smooth Scroll Library
Original library
Online Demo
Issue Tracker
Source Code
Discussion Forum
Waypoints Add-on version 0.0.1-SNAPSHOT
- Providing basic functionality for Waypoints.
- WaypointExtension for creating a Waypoint on a Vaadin component
- InviewExtension to create a Waypoint shortcut on a Vaadin component
- Infinite Scroll has no extension. To provide the same functionality You can use an InviewExtension and add more elements when the InviewEvent is fired.
- Sticky Elements (http://imakewebthings.com/waypoints/shortcuts/sticky-elements/) not supported
- Can use the following vaadin components as context: UI, Window, Panel, Table, HorizontalSplitPanel, VerticalSplitPanel
- Option to use custom scrollable Vaadin components as context
Waypoints Add-on version 0.1
Added support for following contexts: Vaadin Tabsheet, Vaadin Acordion, Vaadin VerticalSplitPanel, HorizontalSplitPanel
Provided another demo view that displays all supported contexts.
Waypoints Add-on version 0.1.1
Added Helper for scrolling into a Vaadin Component