-
Notifications
You must be signed in to change notification settings - Fork 81
Fix Hammerjs unbind events #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,16 +57,16 @@ | |
this.updateOptions(); | ||
|
||
if (typeof $.fn.hammer === 'function' || typeof Hammer !== 'undefined') { | ||
var hammerit, dragData; | ||
var dragData; | ||
if (typeof $.fn.hammer === 'function') | ||
hammerit = this.$image.hammer().data('hammer'); // Get the hammer instance after it has been created. | ||
this.hammerit = this.$image.hammer().data('hammer'); // Get the hammer instance after it has been created. | ||
else | ||
hammerit = Hammer(this.$image.get(0)); | ||
this.hammerit = Hammer(this.$image.get(0)); | ||
// Enable panning in all directions without any threshold. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation is wrong here too.. your commit didn't introduce this, but if you could fix it it will be greatly appreciated, otherwise I can do it after I merge your change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll fix all of it and re-commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something weird is happening. I have none of the indentation issues on my side, but when I push it, the indent is incorrect on github. Have you ever had this issue ? Could you give me your indent size ? And are you using spaces or tabs ? |
||
hammerit.get('pan').set({ direction: Hammer.DIRECTION_ALL, threshold: 0 }); | ||
this.hammerit.get('pan').set({ direction: Hammer.DIRECTION_ALL, threshold: 0 }); | ||
// Enable pinching. | ||
hammerit.get('pinch').set({ enable: true }); | ||
hammerit.on('panleft panright panup pandown', function(e) { | ||
this.hammerit.get('pinch').set({ enable: true }); | ||
this.hammerit.on('panleft panright panup pandown', function(e) { | ||
if (!dragData) | ||
dragData = { | ||
startX: self.img_left, | ||
|
@@ -158,13 +158,8 @@ | |
}, | ||
|
||
remove: function () { | ||
var hammerit; | ||
if (typeof $.fn.hammer === 'function') | ||
hammerit = this.$image.data('hammer'); // Get hammer instance object. | ||
else if (typeof Hammer !== 'undefined') | ||
hammerit = Hammer(this.$image.get(0)); | ||
if (hammerit) | ||
hammerit.off('panleft panright panup pandown panend pancancel doubletap pinchin pinchout'); | ||
if (this.hammerit) | ||
this.hammerit.off('panleft panright panup pandown panend pancancel doubletap pinchin pinchout'); | ||
this.$frame.off('.' + pluginName); | ||
this.$image.off('.' + pluginName); | ||
this.$image.css({width: '', left: '', top: ''}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the indentation of this dragData is not correct anymore.