use anonymous function

This commit is contained in:
tsauerwein
2014-02-28 15:06:18 +01:00
parent bc31d42964
commit fa434bedda
+2 -3
View File
@@ -300,15 +300,14 @@ ol.pointer.PointerEvent.HAS_BUTTONS = false;
/** /**
* Checks if the `MouseEvent` type is supported. * Checks if the `MouseEvent` type is supported.
*/ */
ol.pointer.PointerEvent.checkNewMouseEvent = function() { (function() {
try { try {
var ev = ol.pointer.PointerEvent.createMouseEvent('click', {buttons: 1}); var ev = ol.pointer.PointerEvent.createMouseEvent('click', {buttons: 1});
ol.pointer.PointerEvent.NEW_MOUSE_EVENT = true; ol.pointer.PointerEvent.NEW_MOUSE_EVENT = true;
ol.pointer.PointerEvent.HAS_BUTTONS = ev.buttons === 1; ol.pointer.PointerEvent.HAS_BUTTONS = ev.buttons === 1;
} catch (e) { } catch (e) {
} }
}; })();
ol.pointer.PointerEvent.checkNewMouseEvent();
/** /**