Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 9d0c7d3

Browse files
committed
Merge pull request #46 from menelaos/window-properties
Add `innerWidth` and `innerHeight` for `Window`
2 parents 6e06f0c + df36600 commit 9d0c7d3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/DOM/HTML/Window.js

+12
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,15 @@ exports.location = function (window) {
2020
return window.location;
2121
};
2222
};
23+
24+
exports.innerWidth = function (window) {
25+
return function () {
26+
return window.innerWidth;
27+
};
28+
};
29+
30+
exports.innerHeight = function (window) {
31+
return function () {
32+
return window.innerHeight;
33+
};
34+
};

src/DOM/HTML/Window.purs

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ foreign import document :: forall eff. Window -> Eff (dom :: DOM | eff) HTMLDocu
1010
foreign import navigator :: forall eff. Window -> Eff (dom :: DOM | eff) Navigator
1111

1212
foreign import location :: forall eff. Window -> Eff (dom :: DOM | eff) Location
13+
14+
foreign import innerWidth :: forall eff. Window -> Eff (dom :: DOM | eff) Int
15+
16+
foreign import innerHeight :: forall eff. Window -> Eff (dom :: DOM | eff) Int

0 commit comments

Comments
 (0)