Skip to content

Commit

Permalink
update imgViewer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
waynegm committed Jun 19, 2014
1 parent 1ed269c commit 384a9b9
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions libs/imgViewer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/*
* imgViewer
*
*
* Copyright (c) 2013 Wayne Mogg
* Licensed under the MIT license.
*/

/*! jQuery imgViewer - v0.7.0 - 2014-06-19
* https://github.com/waynegm/imgViewer
* Copyright (c) 2014 Wayne Mogg; Licensed MIT */
/*
* Add a tap and drag gesture to toe.js
*/
Expand Down Expand Up @@ -255,6 +250,14 @@
});

$zimg.mousedown( function(e) {
function endDrag(e) {
e.preventDefault();
stopRenderLoop();
setTimeout(function() { self.dragging = false; }, 0);
$zimg.unbind("mousemove");
$zimg.unbind("mouseup");
$(document).unbind("mouseup");
}
if (self.options.zoomable) {
e.preventDefault();
startRenderLoop();
Expand All @@ -266,14 +269,6 @@
self.vCenter.y = self.vCenter.y - (e.pageY - last.pageY)/self.options.zoom;
last = e;
});
function endDrag(e) {
e.preventDefault();
stopRenderLoop();
setTimeout(function() { self.dragging = false; }, 0);
$zimg.unbind("mousemove");
$zimg.unbind("mouseup");
$(document).unbind("mouseup");
}
$(document).one("mouseup", endDrag);
$zimg.one("mouseup", endDrag);
}
Expand Down

0 comments on commit 384a9b9

Please sign in to comment.