Skip to content

Commit

Permalink
Switched to jQuerys .on() event binding method to stop JAIL from brea…
Browse files Browse the repository at this point in the history
…king other plugins that rely on scroll events.
  • Loading branch information
Christian Engel committed Apr 2, 2013
1 parent ad4a205 commit ea16f13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
archive
node_module
node_modules
_SpecRunner.html
2 changes: 1 addition & 1 deletion dist/jail.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/jail.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
} else {

// Event on the image itself
images.bind( options.event + '.' + options.id, {options: options, images: images}, function(e) {
images.on( options.event + '.' + options.id, {options: options, images: images}, function(e) {
var $img = $(this),
options = e.data.options,
images = e.data.images;
Expand Down Expand Up @@ -180,9 +180,9 @@
}

// Check if there are images to load
if (!!triggerElem && typeof triggerElem.bind === "function") {
triggerElem.bind( options.event + '.' + options.id, {options:options, images : images}, _bufferedEventListener );
$window.bind( 'resize.'+options.id, {options:options, images : images}, _bufferedEventListener );
if (!!triggerElem && typeof triggerElem.on === "function") {
triggerElem.on( options.event + '.' + options.id, {options:options, images : images}, _bufferedEventListener );
$window.on( 'resize.'+options.id, {options:options, images : images}, _bufferedEventListener );
}
}

Expand Down

0 comments on commit ea16f13

Please sign in to comment.