From bdb3e83c06e1662496e4724eb97450be5038b0e0 Mon Sep 17 00:00:00 2001 From: Nikolaus Piccolotto Date: Mon, 13 Jan 2014 19:27:01 +0100 Subject: [PATCH] better comparison --- dist/echo.js | 2 +- dist/echo.min.js | 2 +- src/echo.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/echo.js b/dist/echo.js index 37f7cfa..f0cb067 100644 --- a/dist/echo.js +++ b/dist/echo.js @@ -30,7 +30,7 @@ window.Echo = (function (window, document, undefined) { var opts = obj || {}; offset = opts.offset || 0; 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]'); for (var i = 0; i < nodes.length; i++) { diff --git a/dist/echo.min.js b/dist/echo.min.js index 66e2941..fdfad1c 100644 --- a/dist/echo.min.js +++ b/dist/echo.min.js @@ -1,2 +1,2 @@ /*! 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=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