Skip to content

Commit

Permalink
Removed swipe listener
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-steele committed Jan 28, 2014
1 parent c663208 commit 0c84ff4
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions js/adapt-contrib-hotgraphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,11 @@ define(function(require) {
},

events: function () {
return Adapt.device.touch==false ? {
return {
'click .hotgraphic-graphic-pin':'openHotGraphic',
'click .hotgraphic-popup-done':'closeHotGraphic',
'click .hotgraphic-popup-nav .back':'previousHotGraphic',
'click .hotgraphic-popup-nav .next':'nextHotGraphic'
}:{
'click .hotgraphic-graphic-pin':'openHotGraphic',
'click .hotgraphic-popup-done':'closeHotGraphic',
'click .hotgraphic-popup-nav .back':'previousHotGraphic',
'click .hotgraphic-popup-nav .next':'nextHotGraphic',
'touchstart .hotgraphic-popup-inner':'swipeHotGraphic'
}
},

Expand Down Expand Up @@ -93,21 +87,6 @@ define(function(require) {
this.$('.hotgraphic-item').eq(currentIndex).focus();
},

swipeHotGraphic:function(event){
event.preventDefault();
var originalX = event.originalEvent.touches[0].pageX
this.$('.hotgraphic-popup-inner').one('touchmove', _.bind(
function (event) {
event.preventDefault();
if (event.originalEvent.touches[0].pageX < originalX) {
this.nextHotGraphic(event);
} else {
this.previousHotGraphic(event);
}
}, this)
);
},

previousHotGraphic: function (event) {
event.preventDefault();
var currentIndex = this.$('.hotgraphic-item.active').index();
Expand Down

0 comments on commit 0c84ff4

Please sign in to comment.