Browse Source

better comparison

pull/30/head
Nikolaus Piccolotto 11 years ago
parent
commit
bdb3e83c06
  1. 2
      dist/echo.js
  2. 2
      dist/echo.min.js
  3. 2
      src/echo.js

2
dist/echo.js vendored

@ -30,7 +30,7 @@ window.Echo = (function (window, document, undefined) {
var opts = obj || {}; var opts = obj || {};
offset = opts.offset || 0; offset = opts.offset || 0;
throttle = opts.throttle || 250; throttle = opts.throttle || 250;
domElement = document.querySelector( opts.domElement ) || window; domElement = opts.domElement ? document.querySelector( opts.domElement ) : window;
var nodes = document.querySelectorAll( opts.domElement + ' [data-echo]'); var nodes = document.querySelectorAll( opts.domElement + ' [data-echo]');
for (var i = 0; i < nodes.length; i++) { for (var i = 0; i < nodes.length; i++) {

2
dist/echo.min.js vendored

@ -1,2 +1,2 @@
/*! Echo v1.4.0 | (c) 2014 @toddmotto | MIT license | github.com/toddmotto/echo */ /*! Echo v1.4.0 | (c) 2014 @toddmotto | MIT license | github.com/toddmotto/echo */
window.Echo=function(a,b){"use strict";var c,d,e,f,g=[],h=function(d){var e=d.getBoundingClientRect();return(e.top>=0&&e.left>=0&&e.top)<=(a.innerHeight||b.documentElement.clientHeight)+parseInt(c)},i=function(){for(var a=g.length;a--;){var b=g[a];h(b)&&(b.src=b.getAttribute("data-echo"),g.splice(a,1))}},j=function(){clearTimeout(e),e=setTimeout(i,d)},k=function(e){var h=e||{};c=h.offset||0,d=h.throttle||250,f=b.querySelector(h.domElement)||a;for(var i=b.querySelectorAll(h.domElement+" [data-echo]"),k=0;k<i.length;k++)g.push(i[k]);j(),b.addEventListener?f.addEventListener("scroll",j,!1):f.attachEvent("onscroll",j)};return{init:k,render:j}}(window,document); window.Echo=function(a,b){"use strict";var c,d,e,f,g=[],h=function(d){var e=d.getBoundingClientRect();return(e.top>=0&&e.left>=0&&e.top)<=(a.innerHeight||b.documentElement.clientHeight)+parseInt(c)},i=function(){for(var a=g.length;a--;){var b=g[a];h(b)&&(b.src=b.getAttribute("data-echo"),g.splice(a,1))}},j=function(){clearTimeout(e),e=setTimeout(i,d)},k=function(e){var h=e||{};c=h.offset||0,d=h.throttle||250,f=h.domElement?b.querySelector(h.domElement):a;for(var i=b.querySelectorAll(h.domElement+" [data-echo]"),k=0;k<i.length;k++)g.push(i[k]);j(),b.addEventListener?f.addEventListener("scroll",j,!1):f.attachEvent("onscroll",j)};return{init:k,render:j}}(window,document);

2
src/echo.js

@ -29,7 +29,7 @@ window.Echo = (function (window, document, undefined) {
var opts = obj || {}; var opts = obj || {};
offset = opts.offset || 0; offset = opts.offset || 0;
throttle = opts.throttle || 250; throttle = opts.throttle || 250;
domElement = document.querySelector( opts.domElement ) || window; domElement = opts.domElement ? document.querySelector( opts.domElement ) : window;
var nodes = document.querySelectorAll( opts.domElement + ' [data-echo]'); var nodes = document.querySelectorAll( opts.domElement + ' [data-echo]');
for (var i = 0; i < nodes.length; i++) { for (var i = 0; i < nodes.length; i++) {

Loading…
Cancel
Save