Skip to content

Commit

Permalink
fix mouseover bug i-like-robots#28
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Eife committed Jun 14, 2014
1 parent 83fa585 commit bf3caaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dist/easyzoom.js

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

7 changes: 6 additions & 1 deletion src/easyzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

this.$target = $(target);
this.opts = $.extend({}, defaults, options);
this.mouseOver = false;

if ( this.isOpen === undefined ) {
this._init();
Expand All @@ -56,6 +57,7 @@

this.$target
.on('mouseenter.easyzoom touchstart.easyzoom', function(e) {
self.mouseOver = true;
if ( ! e.originalEvent.touches || e.originalEvent.touches.length === 1) {
e.preventDefault();
self.show(e);
Expand All @@ -68,6 +70,7 @@
}
})
.on('mouseleave.easyzoom touchend.easyzoom', function() {
self.mouseOver = false;
if (self.isOpen) {
self.hide();
}
Expand All @@ -90,7 +93,9 @@

if (! this.isReady) {
this._load(this.$link.attr('href'), function() {
self.show(e);
if (self.mouseOver) {
self.show(e);
}
});

return;
Expand Down

0 comments on commit bf3caaa

Please sign in to comment.