Skip to content

Commit

Permalink
Fix form events on both touch/mouse devices
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Sep 19, 2014
1 parent 2e25051 commit 0e183f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/idangerous.swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ var Swiper = function (selector, params) {
var formElements = $$('input, textarea, select', _this.container);
for (i = 0; i < formElements.length; i++) {
bind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
if (_this.support.touch && params.simulateTouch) {
bind(formElements[i], 'mousedown', releaseForms, true);
}
}
}

Expand Down Expand Up @@ -1068,6 +1071,9 @@ var Swiper = function (selector, params) {
var formElements = $$('input, textarea, select', _this.container);
for (i = 0; i < formElements.length; i++) {
unbind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
if (_this.support.touch && params.simulateTouch) {
unbind(formElements[i], 'mousedown', releaseForms, true);
}
}
}
//Prevent Links Events
Expand Down

0 comments on commit 0e183f3

Please sign in to comment.