Skip to content

Commit 1238a6a

Browse files
author
capynet
committed
Fix bad referencing to "this" on callback call.
1 parent 2652d68 commit 1238a6a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

dist/isInViewport.jquery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
$(window).on('resize scroll', function () {
4141

4242
if (isIn() && _isIn === false) {
43-
plugin.cb('entered')
43+
plugin.cb.call(plugin.$el, 'entered')
4444
_isIn = true
4545
}
4646

4747
if (_isIn === true && !isIn()) {
48-
plugin.cb('leaved')
48+
plugin.cb.call(plugin.$el, 'leaved')
4949
_isIn = false
5050
}
5151

dist/isInViewport.jquery.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

isInViewport.jquery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
$(window).on('resize scroll', function () {
4141

4242
if (isIn() && _isIn === false) {
43-
plugin.cb('entered')
43+
plugin.cb.call(plugin.$el, 'entered')
4444
_isIn = true
4545
}
4646

4747
if (_isIn === true && !isIn()) {
48-
plugin.cb('leaved')
48+
plugin.cb.call(plugin.$el, 'leaved')
4949
_isIn = false
5050
}
5151

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-is-in-viewport",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "React when an element is in the viewport.",
55
"main": "isInViewport.jquery.js",
66
"repository": "https://github.com/frontid/jQueryIsInViewport.git",

0 commit comments

Comments
 (0)