From fa434beddad3542d08c1025f8bdda6295ba708c9 Mon Sep 17 00:00:00 2001 From: tsauerwein Date: Fri, 28 Feb 2014 15:06:18 +0100 Subject: [PATCH] use anonymous function --- src/ol/pointer/pointerevent.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ol/pointer/pointerevent.js b/src/ol/pointer/pointerevent.js index 4546d0130e..720ce11c42 100644 --- a/src/ol/pointer/pointerevent.js +++ b/src/ol/pointer/pointerevent.js @@ -300,15 +300,14 @@ ol.pointer.PointerEvent.HAS_BUTTONS = false; /** * Checks if the `MouseEvent` type is supported. */ -ol.pointer.PointerEvent.checkNewMouseEvent = function() { +(function() { try { var ev = ol.pointer.PointerEvent.createMouseEvent('click', {buttons: 1}); ol.pointer.PointerEvent.NEW_MOUSE_EVENT = true; ol.pointer.PointerEvent.HAS_BUTTONS = ev.buttons === 1; } catch (e) { } -}; -ol.pointer.PointerEvent.checkNewMouseEvent(); +})(); /**