This repository was archived by the owner on Oct 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-13
lines changed Expand file tree Collapse file tree 2 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,15 @@ exports.setSpellcheck = function (spellcheck) {
210210
211211exports . getBoundingClientRect = function ( el ) {
212212 return function ( ) {
213- return el . getBoundingClientRect ( ) ;
213+ var rect = el . getBoundingClientRect ( ) ;
214+ return {
215+ top : rect . top ,
216+ right : rect . right ,
217+ bottom : rect . bottom ,
218+ left : rect . left ,
219+ width : rect . width ,
220+ height : rect . height
221+ } ;
214222 } ;
215223} ;
216224
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module DOM.HTML.HTMLElement
2323 , focus
2424 , blur
2525 , getBoundingClientRect
26+ , DOMRect
2627 , offsetParent
2728 , offsetTop
2829 , offsetLeft
@@ -73,18 +74,16 @@ foreign import click :: forall eff. HTMLElement -> Eff (dom :: DOM | eff) Unit
7374foreign import focus :: forall eff . HTMLElement -> Eff (dom :: DOM | eff ) Unit
7475foreign import blur :: forall eff . HTMLElement -> Eff (dom :: DOM | eff ) Unit
7576
76- foreign import getBoundingClientRect
77- :: forall eff
78- . HTMLElement
79- -> Eff
80- (dom :: DOM | eff )
81- { left :: Number
82- , top :: Number
83- , right :: Number
84- , bottom :: Number
85- , width :: Number
86- , height :: Number
87- }
77+ type DOMRect =
78+ { top :: Number
79+ , right :: Number
80+ , bottom :: Number
81+ , left :: Number
82+ , width :: Number
83+ , height :: Number
84+ }
85+
86+ foreign import getBoundingClientRect :: forall eff . HTMLElement -> Eff (dom :: DOM | eff ) DOMRect
8887
8988foreign import _offsetParent :: forall eff . HTMLElement -> Eff (dom :: DOM | eff ) (Nullable Element )
9089
You can’t perform that action at this time.
0 commit comments