Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
3.7.0pr1 ScrollView Release Notes

3.7.0pr1 ScrollView Release Notes

Y.ScrollView overview

  • Added: axis configuration property to force the axis. If unspecified, ScrollView will attempt to detect which direction to scroll (based off overflow content). ScrollView also now supports scrolling on both axes (not at the same time). axis accepts 'x', 'y', or 'xy', and maps to the scrollview.axis property (an object) after initialization. For example:

     var scrollview = new Y.ScrollView({
     	srcNode: '#myScrollview',
     	width: 400,
     	height: 400,
     	axis: 'xy'
     scrollview.axis === {x:true, y:true}  // true
  • Added: mousewheel is now an attribute, which means support is now optional (previously forced). To disable, scrollview.set('mousewheel', false);

  • Added: Right-to-left layout support. ScrollView detects RTL by looking at the direction attribute typically found in your <html> tag.

  • Added: scrollview.scrollTo() now accepts a Y.Node instance as an optional 5th argument, which represents the node to offset instead of contentBox. This is required for Y.Plugin.ScrollViewPaginator's capability to paginate on dualaxis instances.

  • Added: ScrollView bounding boxes can now have both yui3-scrollview-horiz and yui3-scrollview-vert classes. Previously it was one or the other.

  • Moved: Protected properties that relate to a gesture/movement cycle into a new scrollview._gesture object. If you need to know specifics about start/end X/Y coordinates and deltas, review the code for this object. Also see the API change notes below.

  • Fixed: drag and flick setters to prevent multiple listeners from being assigned.

  • Fixed: Properties _minScrollX, _maxScrollX, _minScrollY, and _maxScrollY are now always present, instead of opposite axis properties being deleted.

  • Fixed: The scrollEnd event now only fires once, and at the end of a scrolling sequence. Previously it could fire twice per scrolling sequence: once when dragging stopped, then again when the flick animation completed. This is a useful event to listen for to know when scrolling is complete, and is now more reliable.

  • Fixed: Mousewheel scrolls now properly update the scrollY attribute

Y.ScrollView API changes

Underscored "_" properties and methods represent protected/private members. They typically do not receive this level of documentation, but due to the frequency of "monkey patching" previous versions of ScrollView by accessing these members, they are being documented here to ease the process of upgrading from a previous version if you run into issues. Hopefully the features and fixes in this update to ScrollView will allow for removal of existing patches.

  • Added: Methods to scrollview

  • _isOOB

  • _snapBack

  • _afterScrollChange

  • _afterScrollEnd

  • _axisSetter

  • Moved: Methods in scrollview

  • _setScroll -> _afterScrollChange

  • Removed: Methods from scrollview

  • _killTimer

  • _moveTo

  • _uiScrollTo

  • Removed: Properties from scrollview

  • lastScrolledAmt

  • _isDragging

  • _flicking

  • _snapToEdge

  • _currentVelocity

  • _pastXEdge

  • _pastYEdge

  • Moved: Methods and properties to scrollview._gesture (new)

  • scrollview._hm -> scrollview._gesture.onGestureMove

  • scrollview._hme -> scrollview._gesture.onGestureMoveEnd

  • scrollview._startClientX -> scrollview._gesture.startClientX

  • scrollview._startClientY -> scrollview._gesture.startClientY

  • scrollview._startX -> scrollview._gesture.startX

  • scrollview._startY -> scrollview._gesture.startY

  • Added: Properties to scrollview._gesture (new)

  • axis

  • endClientX

  • endClientY

  • deltaX

  • deltaY

  • flick

Y.Plugin.ScrollViewPaginator overview

  • Added: cards property, an array of objects. Each page ("card") in your paginator instance now has properties (maxScrollX, maxScrollY, scrollX, scrollY, node) that are needed for paginated scrolling in a dualaxis instance.

  • Moved: Having scrollTo methods on both scrollview and scrollview.pages was confusing, especially since they require different arguments. So scrollview.pages.scrollTo has been moved to scrollview.pages.scrollToIndex, which better reflects its purpose. scrollTo still remains as a deprecated method and maps to scrollToIndex.

  • Fixed: scrollToIndex (previously scrollTo) now updates the index attribute.

  • Fixed: Bug where programmatic access into scrollview.pages.scrollTo may not actually scroll to the desired page, or may cause a lock-up of the widget.

Y.Plugin.ScrollViewPaginator API changes

  • Added: Properties to scrollview.pages

  • axis

  • cards

  • Added: Methods to scrollview.pages

  • _beforeHostScrollTo

  • _afterHostSyncUI

  • Moved: Methods on scrollview.pages

  • _scrollEnded -> _afterHostScrollEnded

  • _onGestureMoveEnd -> _afterHostGestureMoveEnd

  • _mousewheel - > _beforeHostMousewheel

  • Removed: Methods from scrollview.pages

  • _uiEnable

  • _uiDisable

Additional Notes

  • Even though 3.7.0pr1 is only a day old, some of this is already out of date with what will soon be in master (e.g. axis becoming an attribute). So if you are developing off the latest commits, be sure to reference ScrollView's commit history to stay on top of any changes.

If you have any questions or suggestions, please leave a comment. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment