Permalink
Browse files

Unbind mousewheel event listeners when closing the dialog.

  • Loading branch information...
1 parent e199f35 commit 9c7efcd5e487431f04af3fb5e00068ffb6090c88 @blueimp committed May 22, 2011
Showing with 10 additions and 10 deletions.
  1. +10 −10 jquery.image-gallery.js
View
@@ -1,5 +1,5 @@
/*
- * jQuery Image Gallery Plugin 1.2
+ * jQuery Image Gallery Plugin 1.2.1
* https://github.com/blueimp/jQuery-Image-Gallery
*
* Copyright 2011, Sebastian Tschan
@@ -197,15 +197,6 @@
},
closeDialog = function () {
dialog.dialog('close');
- $(document).unbind(
- 'keydown.' + options.namespace,
- keyHandler
- );
- $(document).unbind(
- 'mousewheel.' + options.namespace +
- ', DOMMouseScroll.' + options.namespace,
- wheelHandler
- );
},
slideShow,
scaledImage = this;
@@ -269,6 +260,15 @@
if ($('.' + options.dialogClass).length < 2) {
$('body').removeClass(bodyClass);
}
+ $(document).unbind(
+ 'keydown.' + options.namespace,
+ keyHandler
+ );
+ $(document).unbind(
+ 'mousewheel.' + options.namespace +
+ ', DOMMouseScroll.' + options.namespace,
+ wheelHandler
+ );
clearTimeout(slideShow);
$(this).remove();
}

0 comments on commit 9c7efcd

Please sign in to comment.