The error is because addEventListener is supported only in IE9+, either you need to use attachEvent() or since you have jQuery use it
$(document).on('touchstart', function (e) {
if (!isTextInput(e.target) && isTextInput(document.activeElement)) {
//document.activeElement.blur();
$('input').blur();
}
});