Skip to content

Commit feef32e

Browse files
author
Lukas Appelhans
committed
Give enable/disable functions and enabled property to waypoints
1 parent e53f088 commit feef32e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/shortcuts/inview.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ https://github.com/imakewebthings/waypoints/blog/master/licenses.txt
7979
}
8080
}(config)),
8181
offset: config.offset,
82-
horizontal: this.options.horizontal
82+
horizontal: this.options.horizontal,
83+
enabled: this.options.enabled
8384
}))
8485
}
8586

@@ -90,6 +91,18 @@ https://github.com/imakewebthings/waypoints/blog/master/licenses.txt
9091
}
9192
this.waypoints = []
9293
}
94+
95+
Inview.prototype.disable = function() {
96+
for (var i = 0, end = this.waypoints.length; i < end; i++) {
97+
this.waypoints[i].disable()
98+
}
99+
}
100+
101+
Inview.prototype.enable = function() {
102+
for (var i = 0, end = this.waypoints.length; i < end; i++) {
103+
this.waypoints[i].enable()
104+
}
105+
}
93106

94107
Inview.defaults = {
95108
enter: noop,

0 commit comments

Comments
 (0)