Releases: squat/postpone
Correct bug where `start` did not bind events
Optimize `getElements` method
This commit optimizes the internal getElements
method, which Postpone
uses to locate and register all elements on the page who's resources
should be managed. This code change takes advantage of the fact that if
an element is already being managed by Postpone and the postponed
elements on the page have not changed, then the index of that given
element in the array of postponed elements should already be known. This
allows for the elimination of the Array.prototype.indexOf
method,
effectively changing the line of code from O(n) to O(1).
Correct behavior of `object` elements
This release corrects the postponing of object
elements for certain Webkit browsers.
Account for re-rendering
This release accounts for an edge case where Postpone would not correctly load elements when they had scrolled into view. Specifically, it takes care of the case when a set of already postponed elements are completely re-rendered by an application. Re-rendering a page with the same content may result in completely equivalent markup to the markup that existed before, but from a browser's point of view, the DOM nodes represented by those sets of markup are not identical. Postpone was treating these nodes as identical, so if your Backbone app re-rendered a bunch of still un-loaded images, Postpone would be unable to load them.
Add support for Object
This release adds support for the object
HTML element. You can now use postpone in conjunction with object elements to delay the loading of SVG objects, SWFs, etc.
Enhance postpone with UMD pattern
This commit enhances postpone with a Universal Module Definition
pattern. Employing this pattern means that postpone can now be used
easily in none CJS-style environments and can be used as a stand-alone
module as a browser global.
This commit also removes the docs
directory; the code is thoroughly
documented and interested users can generate docs for it using jsdoc
and similar tools.
Enhance `stop()`, `start()` to unbind/bind events
This commit expands the stop()
and start()
methods to account for
the scroll events associated with already postponed elements.
Previously, calling .stop()
would cause postpone to stop watching for
new postponed elements but would not pause the execution of already
created scroll event callbacks. stop()
now completely pauses
postpone's functionality.
Bug fix for element visibility
This commit fixes a bug where the computed display property of a media
resource was not being properly determined. In particular, the isVisible
method was only considering the element style attribute of the supplied
element and its ancestors.
Important Firefox bug fixes
This release fixes two critical bugs in Firefox. The issue stemmed from differences in how webkit/blink browsers and firefox track the target of scroll events. Additionally, this commit fixes an issue where Firefox would read an incorrect scrollTop value if postpone was not configured with a scroll element.
Add capability to set threshold.
This commit adds new functionality to postpone. You can now set the
threshold, the distance before an edge at which an element should be
considered to be at the edge and loaded. The threshold can be specified
in either vh
or px
units.