Skip to content

Commit c6f8084

Browse files
committed
add Navigator.maxTouchPoints
1 parent 114e035 commit c6f8084

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Web/PointerEvent/PointerEvent.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,10 @@ export function hasPointerCapture(id) {
7676
return el.hasPointerCapture(id);
7777
};
7878
};
79+
}
80+
81+
export function maxTouchPoints(nav) {
82+
return function () {
83+
return nav.maxTouchPoints;
84+
};
7985
}

src/Web/PointerEvent/PointerEvent.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import Web.Internal.FFI (unsafeReadProtoTagged)
3636
import Web.UIEvent.UIEvent (UIEvent)
3737
import Web.UIEvent.MouseEvent (MouseEvent)
3838
import Web.DOM.Element (Element)
39+
import Web.HTML.Navigator (Navigator)
3940

4041
foreign import data PointerEvent :: Type
4142
data PointerType = Mouse | Touch | Pen
@@ -87,3 +88,5 @@ foreign import getPredictedEvents :: PointerEvent -> Array PointerEvent
8788
foreign import setPointerCapture :: PointerId -> Element -> Effect Unit
8889
foreign import releasePointerCapture :: PointerId -> Element -> Effect Unit
8990
foreign import hasPointerCapture :: PointerId -> Element -> Effect Boolean
91+
92+
foreign import maxTouchPoints :: Navigator -> Effect Int

0 commit comments

Comments
 (0)