Fixes Ctrl/Cmd not opening links in new tab.
This commit is contained in:
parent
7baae0bde0
commit
dbb3d5c7c1
1 changed files with 7 additions and 5 deletions
|
|
@ -77,13 +77,15 @@ when defined(js):
|
||||||
# Fire the popState event.
|
# Fire the popState event.
|
||||||
dom.dispatchEvent(dom.window, dom.newEvent("popstate"))
|
dom.dispatchEvent(dom.window, dom.newEvent("popstate"))
|
||||||
|
|
||||||
proc anchorCB*(e: kdom.Event, n: VNode) = # TODO: Why does this need disamb?
|
proc anchorCB*(e: Event, n: VNode) =
|
||||||
e.preventDefault()
|
let mE = e.MouseEvent
|
||||||
|
if not (mE.metaKey or mE.ctrlKey):
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
# TODO: Why does Karax have it's own Node type? That's just silly.
|
# TODO: Why does Karax have it's own Node type? That's just silly.
|
||||||
let url = n.getAttr("href")
|
let url = n.getAttr("href")
|
||||||
|
|
||||||
navigateTo(url)
|
navigateTo(url)
|
||||||
|
|
||||||
type
|
type
|
||||||
FormData* = ref object
|
FormData* = ref object
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue