Skip to content

Commit 0df5230

Browse files
committed
re ordered if statement. Using browser standard over me.device because IE will validate both pointerEnabled && msPointerEnabled.
1 parent 9715309 commit 0df5230

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/input/input.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,29 +168,27 @@
168168
me.event.publish(me.event.WINDOW_ONSCROLL, [ e ]);
169169
}
170170
), false);
171-
172-
// check for the standardized pointerEvent support
173-
if (me.device.pointerEnabled) {
174-
// check for backward compatibility with the 'MS' prefix
175-
if(window.navigator.msPointerEnabled) {
176-
activeEventList = MSPointerEventList;
177-
} else { // standard pointerEvent support
178-
activeEventList = pointerEventList;
179-
}
180-
// `touch****` events for iOS/Android devices
181-
} else if (me.device.touch) {
171+
172+
// check standard
173+
if(window.navigator.pointerEnabled) {
174+
activeEventList = pointerEventList;
175+
}
176+
else if(window.navigator.msPointerEnabled) { // check for backward compatibility with the 'MS' prefix
177+
activeEventList = MSPointerEventList;
178+
}
179+
else if (me.device.touch) { // `touch****` events for iOS/Android devices
182180
activeEventList = touchEventList;
183-
// Regular Mouse events
184-
} else {
181+
}
182+
else { // Regular Mouse events
185183
activeEventList = mouseEventList;
186184
}
187-
185+
188186
registerEventListener(activeEventList, onPointerEvent);
189187

190188
// detect wheel event support
191-
// Modern browsers support "wheel", Webkit and IE support at least "mousewheel
189+
// Modern browsers support "wheel", Webkit and IE support at least "mousewheel
192190
wheeltype = "onwheel" in document.createElement("div") ? "wheel" : "mousewheel";
193-
window.addEventListener(wheeltype, onMouseWheel, false);
191+
window.addEventListener(wheeltype, onMouseWheel, false);
194192

195193
// set the PointerMove/touchMove/MouseMove event
196194
if (obj.throttlingInterval === undefined) {

0 commit comments

Comments
 (0)