From baa78129205f434f6b7d8e58e40dda966e5141db Mon Sep 17 00:00:00 2001 From: Bailey Parker Date: Fri, 15 Aug 2014 13:40:55 -0400 Subject: [PATCH] Detects support using feature detection --- pointer_events_polyfill.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pointer_events_polyfill.js b/pointer_events_polyfill.js index e9d751a..9495e6e 100644 --- a/pointer_events_polyfill.js +++ b/pointer_events_polyfill.js @@ -10,16 +10,8 @@ function PointerEventsPolyfill(options){ selector: '*', mouseEvents: ['click','dblclick','mousedown','mouseup'], usePolyfillIf: function(){ - if(navigator.appName == 'Microsoft Internet Explorer') - { - var agent = navigator.userAgent; - if (agent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/) != null){ - var version = parseFloat( RegExp.$1 ); - if(version < 11) - return true; - } - } - return false; + var dummyStyle = document.createElement('div').style; + return 'pointerEvents' in dummyStyle; } }; if(options){