From 6da1fd5a84e2895c468724a7425eafcbd24e13c3 Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Fri, 21 Jul 2017 00:33:09 +0400 Subject: [PATCH] add pageX pageY to MouseEvent (#114) --- src/DOM/Event/MouseEvent.js | 8 ++++++++ src/DOM/Event/MouseEvent.purs | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/src/DOM/Event/MouseEvent.js b/src/DOM/Event/MouseEvent.js index 535dafd..120b47d 100644 --- a/src/DOM/Event/MouseEvent.js +++ b/src/DOM/Event/MouseEvent.js @@ -16,6 +16,14 @@ exports.clientY = function (e) { return e.clientY; }; +exports.pageX = function (e) { + return e.pageX; +}; + +exports.pageY = function (e) { + return e.pageY; +}; + exports.ctrlKey = function (e) { return e.ctrlKey; }; diff --git a/src/DOM/Event/MouseEvent.purs b/src/DOM/Event/MouseEvent.purs index 49d6044..591227a 100644 --- a/src/DOM/Event/MouseEvent.purs +++ b/src/DOM/Event/MouseEvent.purs @@ -5,6 +5,8 @@ module DOM.Event.MouseEvent , screenY , clientX , clientY + , pageX + , pageY , ctrlKey , shiftKey , altKey @@ -35,6 +37,10 @@ foreign import clientX :: MouseEvent -> Int foreign import clientY :: MouseEvent -> Int +foreign import pageX :: MouseEvent -> Int + +foreign import pageY :: MouseEvent -> Int + foreign import ctrlKey :: MouseEvent -> Boolean foreign import shiftKey :: MouseEvent -> Boolean