Skip to content

Commit

Permalink
0.6.4
Browse files Browse the repository at this point in the history
- fixed bug on older iPads (thx to @Canu667)
- fixed bug on IE triggering error callback before starts loading
- let 'destroy' return 'undefined' to possible redefine own variables
- removed some spacing on line endings
  • Loading branch information
dkern committed Nov 17, 2015
1 parent 7e8a675 commit be97451
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ First of all, you will need a copy of [jQuery](http://jquery.com) to use Lazy su
Lazy is available over [cdnjs](http://cdnjs.com) and [jsDelivr](http://jsdelivr.com) CDN and can directly included to every page.
```HTML
<!-- cdnjs -->
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/0.6.3/jquery.lazy.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/0.6.4/jquery.lazy.min.js"></script>

<!-- jsDeliver -->
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.lazy/0.6.3/jquery.lazy.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.lazy/0.6.4/jquery.lazy.min.js"></script>
```

#### Self-Hosted
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jquery-lazy",
"description": "Lazy is a fast, feature-rich and lightweight delayed content loading plugin for jQuery. It's designed to speed up page loading times and decrease traffic to your users by only loading the content in view. You can use Lazy in all vertical and horizontal scroll ways. It supports images in 'img' tags and backgrounds, supplied with css like 'background-image', by default or any other content by custom loaders. On images Lazy can set an default image or a placeholder while loading and supports retina displays as well.",
"version": "0.6.3",
"version": "0.6.4",
"main": "jquery.lazy.min.js",
"license": [
"MIT",
Expand Down
23 changes: 10 additions & 13 deletions jquery.lazy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery Lazy - v0.6.3
* jQuery Lazy - v0.6.4
* http://jquery.eisbehr.de/lazy/
*
* Copyright 2012 - 2015, Daniel 'Eisbehr' Kern
Expand Down Expand Up @@ -132,13 +132,6 @@
// append plugin instance to all elements
.data("plugin_" + instance.name, instance);

// bind error callback to items if set
if( configuration("onError") )
items.on("error." + instance.name, function()
{
_triggerCallback("onError", $(this));
});

// set default image and/or placeholder to elements if configured
if( configuration("defaultImage") || configuration("placeholder") )
for( var i = 0; i < items.length; i++ )
Expand Down Expand Up @@ -195,11 +188,11 @@
customLoader;

// is not already handled
if( !element.data(configuration("handledName")) &&
if( !element.data(configuration("handledName")) &&
// and is visible or visibility doesn't matter
(!configuration("visibleOnly") || element.is(":visible")) && (
// and image source attribute is available
attribute && (
attribute && (
// and is image tag where attribute is not equal source
(tag == "img" && imageBase + attribute != element.attr("src")) ||
// or is non image tag where attribute is not equal background
Expand All @@ -218,7 +211,7 @@
})(items[i]);

// when something was loaded remove them from remaining items
if( loadTriggered )
if( loadTriggered )
items = $(items).filter(function()
{
return !$(this).data(configuration("handledName"));
Expand Down Expand Up @@ -420,7 +413,9 @@
{
if( (callback = configuration(callback)) )
{
callback.apply(instance, Array.prototype.slice.call(arguments, 1));
// jQuery's internal '$(arguments).slice(1)' are causing problems at least on old iPads
// below is shorthand of 'Array.prototype.slice.call(arguments, 1)'
callback.apply(instance, [].slice.call(arguments, 1));
return true;
}

Expand Down Expand Up @@ -554,7 +549,7 @@
* destroy this plugin instance
* @access public
* @type {function}
* @return void
* @return undefined
*/
_instance.destroy = function ()
{
Expand All @@ -564,6 +559,8 @@

// clear events
_events = {};

return undefined;
};

// start using lazy and return all elements to be chainable or instance for further use
Expand Down
4 changes: 2 additions & 2 deletions jquery.lazy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jquery-lazy",
"title": "jQuery Lazy - Delayed Content, Image and Background Loader",
"version": "0.6.3",
"version": "0.6.4",
"description": "Lazy is a fast, feature-rich and lightweight delayed content loading plugin for jQuery. It's designed to speed up page loading times and decrease traffic to your users by only loading the content in view.",
"homepage": "http://jquery.eisbehr.de/lazy/",
"bugs": "http://github.com/eisbehr-/jquery.lazy/issues",
Expand Down

0 comments on commit be97451

Please sign in to comment.