Skip to content

Commit

Permalink
Merge pull request #10 from edvorg/master
Browse files Browse the repository at this point in the history
do not dispatch route with modifier keys pressed
  • Loading branch information
venantius committed Nov 9, 2015
2 parents 6e814ee + 1eff0f8 commit 1eee43d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/accountant/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@
"click"
(fn [e]
(let [button (.-button e)
meta-key (.metaKey e)
alt-key (.altKey e)
ctrl-key (.ctrlKey e)
shift-key (.shiftKey e)
any-key (or meta-key alt-key ctrl-key shift-key)
href (find-href e)
path (.getPath (.parse Uri href))
title (.-title (.-target e))]
(when (and (= button 0) (secretary/locate-route path))
(when (and (not any-key) (= button 0) (secretary/locate-route path))
(. history (setToken path title))
(.preventDefault e))))))

Expand Down

0 comments on commit 1eee43d

Please sign in to comment.