Created
August 23, 2016 20:44
-
-
Save edtoken/ccdf3b9196bf9bb41717fc52c2448e1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by Ed | |
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
setTimeout(function(e){ | |
var timer = false; | |
function toggle(e){ | |
var target = e.currentTarget; | |
var $target = $(target).find('.chosen-single'); | |
$target.trigger('mousedown'); | |
} | |
var start = undefined; | |
$('.chosen-container').off('touchstart'); | |
$('.chosen-container').on('touchstart', function(e){ | |
start = new Date(); | |
}); | |
$('.chosen-container').on('touchend', function(e){ | |
if(new Date() - start < 250){ | |
var t = e || event; | |
toggle(t); | |
start = undefined; | |
} | |
}); | |
}, 1500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment