Skip to content

Commit

Permalink
Merge pull request #23 from adaptlearning/issue/19
Browse files Browse the repository at this point in the history
Removed swipe listener
  • Loading branch information
darylhedley committed Jan 28, 2014
2 parents c663208 + 0c84ff4 commit 4117325
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 4117325

Please sign in to comment.