Commit 3bf0a9bd authored by James Laver's avatar James Laver

tidy up G.C.ContextMenu.ContextMenu

parent c9536adc
...@@ -57,10 +57,10 @@ contextMenuEffect ...@@ -57,10 +57,10 @@ contextMenuEffect
. (Maybe t -> Effect Unit) . (Maybe t -> Effect Unit)
-> R.Ref (Nullable DOM.Element) -> R.Ref (Nullable DOM.Element)
-> Unit -> Effect (Unit -> Effect Unit) -> Unit -> Effect (Unit -> Effect Unit)
contextMenuEffect setMenu ref _ = contextMenuEffect setMenu rootRef _ =
case toMaybe $ R.readRef ref of case R.readNullableRef rootRef of
Just elem -> do Just root -> do
let onClick = documentClickHandler setMenu elem let onClick = documentClickHandler setMenu root
let onScroll = documentScrollHandler setMenu let onScroll = documentScrollHandler setMenu
DOM.addEventListener document "click" onClick DOM.addEventListener document "click" onClick
DOM.addEventListener document "scroll" onScroll DOM.addEventListener document "scroll" onScroll
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment