Skip to content

Commit

Permalink
fix for #4
Browse files Browse the repository at this point in the history
  • Loading branch information
dethe committed Mar 18, 2015
1 parent 88a66e2 commit 31ad664
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions nanomodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,19 @@ function El(tag, classNames) {
}
};


});
var addClickListener = function(handler) {
if ("ontouchend" in document.documentElement) {
addListener("touchstart", handler);
} else {
addListener("click", handler);
var flag = false;
var wrappedHandler = function(evt){
if (!flag){
flag = true;
setTimeout(function(){ flag = false; }, 100);
handler(evt);
}
}
addListener("touchstart", wrappedHandler);
addListener("click", wrappedHandler);
};

var show = function(arg) {
Expand Down Expand Up @@ -371,7 +378,7 @@ var ModalEvent = require("./ModalEvent");

var nanoModalAPI = (function() {



var El = require("./El");
var Modal = require("./Modal");
Expand Down

0 comments on commit 31ad664

Please sign in to comment.