Skip to content
This repository was archived by the owner on Jan 16, 2020. It is now read-only.

Commit a02429b

Browse files
committed
Don't overwrite the existing polyfill if it exists
1 parent e7a0a6e commit a02429b

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/pointer.js

+12-13
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ if ( !Object.keys ) {
1717
}
1818
}
1919

20-
PointerEventsPolyfill = {
21-
external: {
22-
contains: $.contains,
23-
addEvent: function( target, eventName ) {
24-
$( target ).on( eventName, this.boundHandler );
25-
},
26-
removeEvent: function( target, eventName ) {
27-
$( target ).off( eventName, this.boundHandler );
28-
},
29-
dispatchEvent: function( event ) {
30-
var target = this.getTarget( event );
31-
$( target ).trigger( event );
32-
}
20+
window.PointerEventsPolyfill = window.PointerEventsPolyfill || {};
21+
window.PointerEventsPolyfill.external = {
22+
contains: $.contains,
23+
addEvent: function( target, eventName ) {
24+
$( target ).on( eventName, this.boundHandler );
25+
},
26+
removeEvent: function( target, eventName ) {
27+
$( target ).off( eventName, this.boundHandler );
28+
},
29+
dispatchEvent: function( event ) {
30+
var target = this.getTarget( event );
31+
$( target ).trigger( event );
3332
}
3433
};
3534

0 commit comments

Comments
 (0)