lafikl/steady.js — pull request #7 by davidcl64 (2014-06-12 03:00:02+00:00)
Title: Refactor common logic into single method

Reduced some code duplication and saved a few bytes (463) by refactoring some
of the basic +addXXX property trackers into a common function.

Replaced:

_addScrollX()
_addScrollY()
_addScrollLeft()
_addScrollTop()
_addWidth()

with:

_addPropertyTracker(trackerName, propertyName)

Pass in either scrollElement (if specified) or window (if not) to the
tracker during _onScroll.

Changed the tracker's incoming param’s name to el from window as a
better indicator of what might be coming in (though neither is
accurate…)