From 1e4bf035d1fa90b91a0ba829eb1ef1f1fcae49a4 Mon Sep 17 00:00:00 2001 From: Andy Pillip
Date: Thu, 25 Feb 2016 18:45:36 +0100 Subject: [PATCH 1/6] Enabled initial event for off-view elements Before off-view elements would only get their event after they got in view once --- jquery.inview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.inview.js b/jquery.inview.js index 0634f16..d6d455b 100644 --- a/jquery.inview.js +++ b/jquery.inview.js @@ -123,7 +123,7 @@ if (!inView) { $element.data('inview', true).trigger('inview', [true]); } - } else if (inView) { + } else if (inView || typeof inView === 'undefined') { $element.data('inview', false).trigger('inview', [false]); } } From 91d40680533025f89f5a0f5cd9178c38fbd8ea36 Mon Sep 17 00:00:00 2001 From: Andy Pillip
Date: Tue, 1 Mar 2016 09:31:18 +0100 Subject: [PATCH 2/6] Testing initial event for not-in-view elements Just turned around the current test from negative to positive --- test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 6e84b55..f96e423 100644 --- a/test/test.js +++ b/test/test.js @@ -50,7 +50,7 @@ window['jQuery 1.8'].each(['jQuery 1.8', 'jQuery 1.12', 'jQuery 2.2'], function( setTimeout(function() { $(window).scrollTop(0).scrollLeft(0); - ok(!firstCall, 'inview shouldn\'t be triggered initially when the element isn\'t in the viewport'); + ok(firstCall, 'Triggered handler initially even when the element isn\'t in the viewport'); element.unbind('inview.firstCall'); element.bind('inview.secondCall', function(event, inViewParam) { secondCall = true; @@ -99,7 +99,7 @@ window['jQuery 1.8'].each(['jQuery 1.8', 'jQuery 1.12', 'jQuery 2.2'], function( setTimeout(function() { $(window).scrollTop(0).scrollLeft(0); - ok(!firstCall, 'inview shouldn\'t be triggered initially when the element isn\'t in the viewport'); + ok(firstCall, 'Triggered handler initially even when the element isn\'t in the viewport'); element.unbind('inview.firstCall'); element.bind('inview.secondCall', function(event, inViewParam) { secondCall = true; From 3054bd2102e25da63db3dbc044411c6910f1419a Mon Sep 17 00:00:00 2001 From: Andy Pillip
Date: Tue, 1 Mar 2016 10:47:37 +0100 Subject: [PATCH 3/6] Corrected event description --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a404e7..18405ab 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Element 'inview' Event Plugin -Event that is fired as soon as an element appears in the user's viewport. +Event that is fired when an element enters or leaves the user's viewport. * **Author:** [Christopher Blum](http://twitter.com/ChristopherBlum) * **Original idea and concept by:** [Remy Sharp](http://remysharp.com/2009/01/26/element-in-view-event-plugin/) @@ -61,4 +61,4 @@ The Test Suite succeeds in the following browsers that were tested: * Chrome 7+ * Opera 10+ * IE 6+ -* Mobile Safari on iPad 4.2.2 \ No newline at end of file +* Mobile Safari on iPad 4.2.2 From 76104eb2cecb327729b4d8b1d98f4457100d84a7 Mon Sep 17 00:00:00 2001 From: Andy Pillip
Date: Tue, 8 Aug 2017 11:17:28 +0200
Subject: [PATCH 4/6] Minified updated version
---
jquery.inview.min.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jquery.inview.min.js b/jquery.inview.min.js
index d45d86c..7989fa8 100644
--- a/jquery.inview.min.js
+++ b/jquery.inview.min.js
@@ -1 +1 @@
-!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function i(){var b,c,d={height:f.innerHeight,width:f.innerWidth};return d.height||(b=e.compatMode,(b||!a.support.boxModel)&&(c="CSS1Compat"===b?g:e.body,d={height:c.clientHeight,width:c.clientWidth})),d}function j(){return{top:f.pageYOffset||g.scrollTop||e.body.scrollTop,left:f.pageXOffset||g.scrollLeft||e.body.scrollLeft}}function k(){if(b.length){var e=0,f=a.map(b,function(a){var b=a.data.selector,c=a.$element;return b?c.find(b):c});for(c=c||i(),d=d||j();e
Date: Tue, 8 Aug 2017 13:42:48 +0200
Subject: [PATCH 6/6] Bumped version+forkname
To solve issues with bower getting the wrong version
---
bower.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bower.json b/bower.json
index 85024b2..b1e7eb9 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "ch.crafft.jquery.inview",
- "version": "1.1.2",
+ "version": "1.1.3-crafft",
"main": "jquery.inview.js",
"description": "jQuery event that is fired as soon as an element appears in the user's viewport."
}